哥们,你首先要取得用户的姓名才行啊,
如果你的代理是在文档的事件里触发执行的
你可以在在文档里建立一个CurUsername(显示时计算),公式为@username
然后使用
dim session as new notessession
dim doc as notesdocument
set doc=session.documentcontext
1. This script mails a document and its form. The document is mailed to the recipients contained in the SendTo item of the document.
Dim doc as NotesDocument
'...set value of doc...
Call doc.Send( True )
2. This script sets the value of the SendTo item in a document. It then mails the document and its form. The document gets mailed to Carl Pycha.
Call doc.ReplaceItemValue( "SendTo", "Carl Pycha" )
Call doc.Save( False, True )
Call doc.Send( True )
3. This script mails a document to Sally Bowles. The form is not mailed.
Call doc.Send( False, "Sally Bowles" )
4. This script mails a document and its form to Jim Dinauer, Betty Dinauer, and Mary Sticka.
Dim recipients( 1 To 3 ) As String
recipients( 1 ) = "Jim Dinauer"
recipients( 2 ) = "Betty Dinauer"
recipients( 3 ) = "Mary Sticka"
Call doc.Send( True, recipients )
5. This script mails a document to anyone listed in its DocAuthor field.
Call doc.Send( True, doc.DocAuthor )
6. This script creates a new document in the current database and mails it to Elissa Minty.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = New NotesDocument( db )
doc.Form = "Memo"
doc.SendTo = "Elissa Minty"
doc.Subject = "Here's the document you wanted"
Call doc.Send( False )