例: AddDocument method

次の例は collectionA から collectionB に文書を追加し、collectionB を「Business documents」フォルダに入れます。

Sub Click(Source As Button)
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim collectionA As NotesDocumentCollection
  Dim collectionB As NotesDocumentCollection
  Dim doc As NotesDocument
  
  Set db = session.CurrentDatabase
  Set collectionA = db.FTSearch("Annual reports", 10)
  Set collectionB = db.FTSearch("Business reports",10)
  Set doc = collectionA.GetLastDocument
  Call collectionB.AddDocument(doc)
  Call collectionB.PutAllInFolder("Business documents")
End Sub