par steve » 24 Oct 2002 à 17:05
moi j'ai fait ca en lancant un LotusScript ... dont voilà le code ...Sub Initialize Dim session As New NotesSession Dim db As NotesDatabase Dim collection As NotesDocumentCollection Dim doc As NotesDocument Dim j As Integer Dim str_array As Variant Dim ChosenUsername As String Dim ChosenPassword As String Dim num_docs As Integer Dim dateTime As New NotesDateTime("1/1/97") On Error Goto ErrorHandler Set doc = session.DocumentContext Set db = session.CurrentDatabase Dim NamesDb As New NotesDatabase("", "NAMES.nsf") Dim FoundList As NotesDocumentCollection Dim NameDoc Dim eval As Variant str_array = doc.GetItemValue("NotesUserName") ChosenUsername = str_array(0) str_array = doc.GetItemValue("NewPassword") ChosenPassword = str_array(0) ' Open Name and Address Book then search for a ' document that contains the ChosenUsername in ' the FullName field. Then you need to set the ' HTTPassword field in this document to the ' ChosenPassword value. Finally save this document ' in the Name and Address Book. At this time you can ' also delete the document in the SetPassword database ' that triggered this change. Otherwise every time the ' agent ran, it would just set the password over and over again. ' Set FoundList = NamesDb.Search("ShortName = """ + ChosenUsername + """", dateTime, 0) Set FoundList = NamesDb.Search("FullName = """ + ChosenUsername + """", dateTime, 0) If FoundList.count > 0 Then Set NameDoc = FoundList.GetNthDocument(1) Call NameDoc.ReplaceItemValue("HTTPPassword", ChosenPassword) ' Use @Password formula code to scramble the new password value. ' Use LotusScript Evaluate function to execute the formula statement ' in LotusScript. eval = Evaluate("@Password(HTTPPassword)", NameDoc) Call NameDoc.ReplaceItemValue("HTTPPassword", eval) Call NameDoc.Save(False, False) End If doc.Remove(True) Exit Sub ErrorHandler: Dim ErrString As String ErrString="INITIALIZE : Script Error on Line : " + Cstr(Erl()) + Chr(10)+Chr(10)+"Error Message : " + Error$ Print doc.ErrorFieldErrString=ErrString 'In WebQueryOpen agent use doc.ErrorField=ErrString Exit Sub End Subvoilou et bonne chancesteve