例: CopyAllItems method

次のエージェントは、ハイライト表示された文書 docA 上のすべてのアイテムを新しい文書 docB にコピーして、docB を保存します。

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim docA As NotesDocument
  Dim docB As NotesDocument
  Dim collection As NotesDocumentCollection
  Set db = session.CurrentDatabase
  Set collection = db.UnprocessedDocuments
  Set docA = collection.GetFirstDocument()
  If Not (docA Is Nothing) Then
    Set docB = New NotesDocument( db )
    Call docA.CopyAllItems( docB, True )
    Call docB.Save( True, True )
  Else
    Messagebox "No documents found"
  End If
End Sub