Sub Initialize()
On Error GoTo a
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.Currentdatabase
Dim strRegServer As String
Dim strDelUserorg As Variant
'获得当前数据库所在服务的组织名:CN=oaserver/O=v4.2
strRegServer = db.Server
'获得组织中的域名:v4.2
strDelUserorg = Evaluate("@Name([o];@UserName)")
MsgBox "strRegServer:---" & strRegServer
MsgBox "strDelUserorg:---" & strDelUserorg(0)
Dim adminp As NotesAdministrationProcess
Set adminp = session.CreateAdministrationProcess(strRegServer)
Dim userName As Variant
Dim DeleUser As Variant
DeleUser = "ddd"
'拼出服务器域中的用户:ddd/v4.2
userName = CStr(DeleUser+"/" & strDelUserorg(0) )
MsgBox "userName:---" & userName
'在names库中删除指定的用户
Call adminp.DeleteUser(userName, True, MAILFILE_DELETE_ALL,"", False)
Exit Sub
a:
MsgBox "错误在agent_DelUser的第" & Erl & "行:" & Error
End Sub
On Error GoTo a
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.Currentdatabase
Dim strRegServer As String
Dim strDelUserorg As Variant
'获得当前数据库所在服务的组织名:CN=oaserver/O=v4.2
strRegServer = db.Server
'获得组织中的域名:v4.2
strDelUserorg = Evaluate("@Name([o];@UserName)")
MsgBox "strRegServer:---" & strRegServer
MsgBox "strDelUserorg:---" & strDelUserorg(0)
Dim adminp As NotesAdministrationProcess
Set adminp = session.CreateAdministrationProcess(strRegServer)
Dim userName As Variant
Dim DeleUser As Variant
DeleUser = "ddd"
'拼出服务器域中的用户:ddd/v4.2
userName = CStr(DeleUser+"/" & strDelUserorg(0) )
MsgBox "userName:---" & userName
'在names库中删除指定的用户
Call adminp.DeleteUser(userName, True, MAILFILE_DELETE_ALL,"", False)
Exit Sub
a:
MsgBox "错误在agent_DelUser的第" & Erl & "行:" & Error
End Sub