次の例では、doc は値を次のように設定済みの NotesDocument です。
Dim session As NotesSession
Dim db As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Set session = New NotesSession
Set db = session.CurrentDatabase
Set dc = db.UnprocessedDocuments 'This property only works in an agent that runs against a set of documents.
Set doc = dc.GetFirstDocument
Dim subj As Variant
subj = doc.GetItemValue( "Subject" )
Messagebox( subj( 0 ) )
Dim subj As Variant
subj = doc.Subject
Messagebox( subj( 0 ) )
Dim total As Integer
Dim money As Variant
total = 0
money = doc.GetItemValue( "quarterlyRevenue" )
Forall m In money
total = total + m
End Forall
Call doc.ReplaceItemValue( "totalRevenue", total )
Call doc.Save( False, True )
Dim total As Integer
Dim money As Variant
total = 0
money = doc.quarterlyRevenue
Forall m In money
total = total + m
End Forall
doc.totalRevenue = total
Call doc.Save( False, True )
Sub Initialize
Dim memo As NotesDocument
Set memo = New NotesDocument( db )
Dim bodytext As Variant
bodytext = doc.GetItemValue( "Body" )
Call memo.ReplaceItemValue( "Body", bodytext )
Call memo.ReplaceItemValue( "Subject", _
"Here's some plain text" )
Call memo.ReplaceItemValue( "Form", "Memo" )
Call memo.Send( False, _
"dbattersly @ purple.peoplepleaser.org @ internet" )
End Sub
Sub Initialize
Dim memo As NotesDocument
Set memo = New NotesDocument( db )
memo.Body = doc.Body
memo.Subject = "Here's some plain text"
memo.Form = "Memo"
Call memo.Send( False, _
"dbattersly @ purple.peoplepleaser.org @ internet" )
End Sub