Declare Function SECKFMChangePassword Lib "c:\lotus\notes\nnotes.dll" (Byval IDFile$,Byval OldPassword$,Byval NewPassword$)As IntegerDeclare Function SECKFMSwitchToIDFile Lib "c:\lotus\notes\nnotes.dll" (Byval IDFile$,Byval Password$,Byval UserName$, Byval MaxUserNameLength%,Byval ReservedFlag%26amp;,Byval flag%26amp;)As IntegerDeclare Function OSLoadString Lib "c:\lotus\notes\nlib.dll" (Byval hModule%26amp;, Byval Status%, Byval retBuffer$, Byval BufferLength%) As IntegerConst MAXUSERNAME=256Type ID_INFOName As StringPassword As StringEnd TypeFunction APICheckError(Error%) As StringDim s$, x%If Error% 0 Thens$ = Space$(254)x% = OSLoadString(0, Error%, s$, 254) If x% = 0 Thens$ = "General Notes Error"Elses$ = Left$(s$,x%)End If APICheckError= s$End If End FunctionSub APISwitchID(filepath$, passwordlist, id As ID_Info, s$)Dim Status%Dim Flag%Dim UserName As String * MAXUSERNAMEID.Name="NA"ID.Password= "NA"Flag%=FalseForall x In PasswordListpword$=Cstr(x)Print s %26amp; " Checking Password ......" %26amp; Pword$ ,filepath$Status%=SECKFMSwitchToIDFile(filepath$,pword$,UserName,MAXUSERNAME,0,0)If Status% =0 Then Print Now " Change Password SUCCESS "'Call CreateIDDoc(filepath$,UserName,pword$,filepath$)Flag%=TrueID.Name=UserNameID.Password= Cstr(x)Exit ForallElsePrint "Error " %26amp; APICheckError(status%)Print" Change Password ERROR "Print" ERROR "End IfStatus%=0YieldEnd ForallIf Flag%=False ThenPrint Now %26amp; " ERROR Could Not Add file "End IfEnd SubFunction APIChangePword(IDFile$, OldPword$, NewPword$)As IntegerDim Status%Status%=SECKFMChangePassword(IDFile$,OldPword$,NewPword$)If Status% =0 Then Print"Change Password SUCCESS "APIChangePword=TrueElsePrint"Change Password ERROR "Print"ERROR "APIChangePword=FalseEnd IfEnd Function
,