我也是如楼上兄这样作的,但总是不能利马生效。原代码如下,请大侠指正:
Sub Initialize
Dim ns As NotesSession
Dim db As NotesDatabase
Dim viewDoc As NotesDocument
Dim doc As Notesdocument
Dim view As NotesView
Dim User As String
Dim Pwd As String
Dim eldPwd As String
Dim confirmPwd As String
Dim k As String
k=0
Set ns=New NotesSession()
Set doc=ns.DocumentContext
User=doc.UserName(0)
Pwd=doc.NewPwd(0)
eldPwd=doc.oldPwd(0)
confirmPwd=doc.ConfirmPwd(0)
Set db=ns.GetDatabase("","Names.nsf")
Set view=db.getView("People")
Set viewDoc=view.GetFirstDocument
Print "<BODY BACKGROUND='/nbbbs.nsf/bg-l.jpg'>"
If Pwd=confirmPwd Then
Do Until (viewdoc Is Nothing)
If Lcase(viewDoc.ShortName(0))=Lcase(User) And viewDoc.HTTPPassword(0)=eldPwd Then
If Pwd<>"" Then
viewDoc.HTTPPassword=Pwd
k=1
End If
viewDoc.Save True,False
If k=1 Then Exit Do
End If
Set viewDoc=view.GetNextDocument(viewDoc)
Loop
If k=0 Then
Print "<br><font size=+2><b><P align=center>The old password isn't correct , Please try agin !"
Print "<br><p align=center><input type=button value='Go Back' onclick='JavaScript:history.go(-1)'></P>"
Else
Print "<br><b><font size=+2><p align=center>Change successfully !</p></font></b>"
Print "<br><b><font size=+1><p align=center>The new password will be effective when next login.</p></font></b>"
End If
Else
Print "<br><b><p align=center><font size=+2>New Password isn't equal to confirm Password ,Please check it !</font></p></b>"
Print "<br><p align=center><input type=button value='Go Back' onclick='JavaScript:history.go(-1)'></P>"
End If