par Droad » 18 Nov 2003 à 21:41
Créer une baseAjouter un agent LS "Executer une fois", à lancer manuellement:Sub Initialize Dim s As New NotesSession Dim db As NotesDatabase Set db = s.CurrentDatabase Dim nab1 As New NotesDatabase("SERVER1","names.nsf") Dim nab2 As New NotesDatabase("SERVER2","names.nsf") Call compareNabs(nab1,nab2,db) Call compareNabs(nab2,nab1,db)End SubSub compareNabs(nabA As NotesDatabase, nabB As NotesDatabase, logDb As NotesDatabase) On Error 4091 Goto notInNab Dim entry As NotesDocument, link As NotesRichTextItem Dim users As NotesView, person As NotesDocument Dim execDate As Variant Set users = nabA.GetView("People") Set person = users.GetFirstDocument() execDate = Now While Not person Is Nothing Print person.Fullname(0) Call nabB.GetDocumentByUnid(person.UniversalId) Set person = users.GetNextDocument(person) Wend Exit Sub notInNab: Set entry = New NotesDocument(logDb) entry.Form = "Entry" entry.Date = execDate entry.Server = nabA.Server entry.Unid = person.UniversalId entry.Fullname = person.Fullname Set link = New NotesRichTextItem(entry,"Link") Call link.AppendDocLink(person, "") Call entry.Save(True,False) Resume NextEnd Sub[%sig%]