bon changement de programme, mon serveur (et surtout la sécurité) ne veut pas envoyer vers hotmail (j'aurais dû m'en douter) donc je te poste le tout ici...c'est un peu long

) j'ai un agent d'importation d'excel vers notes, et il fait une comparaison sur la valeur d'une colonne, tu pourras peut-être l'adapter pour que ça fonctionne dans l'autre sens.Si tu as besoin d'un complément d'explications, n'hesites pas. Déclarations : Dim xlFilename As String Dim db As NotesDatabase Dim view As NotesView Dim doc As NotesDocument Dim row As Integer Dim Excel As Variant Dim xlWorkbook As Variant Dim xlSheet As Variant Dim chercheSociete As NotesDocumentCollection Dim docTrouveSociete As NotesDocument Dim valeur As Variant Dim valNom As Variant Dim valPrenom As Variant Dim Continue As Variant Initialize : Sub Initialize %REM lucie 24/10/2002 Agent permettant la mise à jour des informations contenues dans D:\Marketing\Contact.xls et les envoi vers la vue (VFicheContact) %END REM On Error Goto erreur xlFilename = "D:\Marketing\Contact.xls" '// chemin du dossier excel devant être importé Dim session As New NotesSession Set db = session.CurrentDatabase Set view = db.GetView("(VFicheContact)") '// vue dans laquelle on importe Set Excel = CreateObject( "excel.application" ) Excel.Visible = False ' empeche l'ouverture de la fenetre Excel Excel.Workbooks.Open xlFilename Set xlWorkbook = Excel.ActiveWorkbook Set xlSheet = xlWorkbook.ActiveSheet '// Cycle through the rows of the Excel file, pulling the data over to Notes Continue=True row=1 While Continue Set valeur = xlSheet.Cells( row, 16 ) ' Prend la colonne correspondante à Société ds excel If Trim(Cstr(valeur.value))="" Then ' Si plus de valeur, alors Fin Continue=False Else Set valNom = xlSheet.Cells( row, 2 ) Set valPrenom = xlSheet.Cells( row, 3 ) ' Met en minuscule et concatene les valeurs de Société+Nom+Prenom ds excel contact = Lcase(Cstr(valeur.value) & Cstr(valNom.value) & Cstr(valPrenom.value)) ' Recherche les valeurs exactes communes entre SocieteXL et la vue et fait une collection Set docTrouveSociete = view.GetDocumentByKey (contact, False ) If docTrouveSociete Is Nothing Then Call Creation() Else Call MiseAJour (docTrouveSociete) End If End If ' pour Cstr(valeur.value) row=row+1 Wend Excel.Quit '// ferme Excel Set Excel = Nothing '// Free the memory that we'd used Print " " '//Clear the status line Exit Sub erreur: If Not (Excel Is Nothing) Then Excel.Quit '// ferme Excel Set Excel = Nothing '// Free the memory that we'd used Print " " '//Clear the status line End If Print Error$ Close Exit Sub End Sub Creation : Sub Creation With xlSheet Set doc = db.CreateDocument '// Create a new doc doc.Form = "ContactsEntreprise" '// masque de référence doc.Civilité=.Cells( row, 1 ).Value doc.NomContact=.Cells( row, 2 ).Value doc.Prenom=.Cells( row, 3 ).Value doc.Fonction=.Cells( row, 4 ).Value doc.FonctionDet=.Cells( row, 5 ).Value doc.Service=.Cells( row, 6 ).Value doc.NumeTelBureau=.Cells( row, 7 ).Value doc.NumeTelStand=.Cells( row, 8 ).Value doc.NumeTelPortable=.Cells( row, 9 ).Value doc.NumeTelAutre=.Cells( row, 10 ).Value doc.Source=.Cells( row, 11 ).Value doc.EmailContact=.Cells( row, 12 ).Value doc.FaxContact=.Cells( row,13).Value doc.Hobbies=.Cells(row,14).Value doc.AutreQualif=.Cells( row,15).Value doc.Societe=.Cells( row,16).Value doc.AdresseSociete=.Cells( row,17).Value doc.AdresseSoc=.Cells( row,18).Value doc.CPSociete=.Cells( row,19).Value doc.VilleSociete=.Cells( row,20).Value doc.Region=.Cells( row,21).Value doc.PaysSociete=.Cells( row,22).Value doc.SiteWeb=.Cells( row,23).Value doc.Secteur=.Cells( row,24).Value doc.Autresource=.Cells( row,25).Value doc.CreatCt=.Cells( row,26).Value doc.DateCreation=.Cells( row,27).Value doc.Modif=.Cells( row,28).Value doc.Motifs=.Cells( row,29).Value Call doc.Save( True, True ) '// Save the new doc End With End Sub MiseAJour : Sub MiseAJour (docmaj As notesdocument) With xlSheet Dim item As NotesItem Set item = docmaj.ReplaceItemValue( "Societe",.Cells( row,16).Value ) Set item = docmaj .ReplaceItemValue( "NomContact",.Cells( row, 2 ).Value ) Set item = docmaj.ReplaceItemValue( "Prenom",.Cells( row, 3 ).Value) Set item = docmaj .ReplaceItemValue( "civilité",.Cells( row, 1 ).Value ) Set item = docmaj.ReplaceItemValue( "Fonction",.Cells( row, 4 ).Value) Set item = docmaj.ReplaceItemValue( "FonctionDet",.Cells( row, 5 ).Value) Set item = docmaj.ReplaceItemValue( "Service",.Cells( row, 6 ).Value) Set item = docmaj.ReplaceItemValue( "NumeTelBureau",.Cells( row, 7 ).Value) Set item = docmaj.ReplaceItemValue( "NumeTelStand",.Cells( row, 8 ).Value) Set item = docmaj.ReplaceItemValue( "NumeTelPortable",.Cells( row, 9 ).Value) Set item = docmaj.ReplaceItemValue( "NumeTelAutre",.Cells( row, 10 ).Value) Set item = docmaj.ReplaceItemValue( "Source",.Cells( row,11).Value) Set item = docmaj.ReplaceItemValue( "EmailContact",.Cells( row, 12 ).Value) Set item = docmaj.ReplaceItemValue( "FaxContact",.Cells( row,13).Value) Set item = docmaj.ReplaceItemValue( "Hobbies",.Cells( row,14).Value ) Set item = docmaj.ReplaceItemValue( "AutreQualif",.Cells( row,15).Value ) Set item = docmaj.ReplaceItemValue( "AdresseSociete",.Cells( row,17).Value) Set item = docmaj.ReplaceItemValue( "AdresseSoc",.Cells( row,18).Value) Set item = docmaj.ReplaceItemValue( "CPSociete",.Cells( row,19).Value) Set item = docmaj.ReplaceItemValue( "VilleSociete",.Cells( row,20).Value) Set item = docmaj.ReplaceItemValue( "Region",.Cells( row,21).Value ) Set item = docmaj.ReplaceItemValue( "PaysSociete",.Cells( row,22).Value) Set item = docmaj.ReplaceItemValue( "SiteWeb",.Cells( row,23).Value) Set item = docmaj.ReplaceItemValue( "Secteur",.Cells( row,24).Value) Set item = docmaj.ReplaceItemValue( "Autresource",.Cells( row,25).Value ) Set item = docmaj.ReplaceItemValue( "CreatCt",.Cells( row,26).Value ) Set item = docmaj.ReplaceItemValue( "DateCreation",.Cells( row,27).Value ) Set item = docmaj.ReplaceItemValue( "Modif",.Cells( row,28).Value ) Set item = docmaj.ReplaceItemValue( "Motifs",.Cells( row,29).Value ) Call docmaj.Save( True, True ) End With End Sub