Sub Initialize
Dim session As New NotesSession
Dim CurrentDb As NotesDatabase
Dim Addressbook As NotesDatabase
Dim doc As NotesDocument
Dim view As NotesView
Dim j As Integer
Set CurrentDb = session.CurrentDatabase
Set Addressbook = session.GetDatabase(CurrentDb.server,"names.nsf")
Set view = Addressbook.GetView( "People" )
un = Evaluate("@Name([Abbreviate];@UserName)")
If Instr(1,un(0)," ") <> 0 Then
s1 = Mid(un(0), 1, Instr(1,un(0)," "))
s2 = Right(un(0), Len(un(0)) - Instr(1,un(0)," "))
s3 = s1 + " and " + s2
Else
s3 = un(0)
End If
j = view.FTSearch( s3, 1)
If j <> 0 Then
Set doc = view.GetFirstDocument
MailNsf = doc.MailFile
If MailNsf(0) = "" Then
Print "没有找到您的邮件文件!"
Else
If Right(MailNsf(0),4) <> ".nsf" Then
mailURL = MailNsf(0) + ".nsf"
Else
mailURL = MailNsf(0)
End If
mailURL = Trim(mailURL)
Print "[http://oa.nullsite.com:8009" + "/" + mailURL + "]"
End If
Else
Print "没有找到您的邮件文件!"
End If
End Sub