Examples: AddDocument method

This example adds a document from collectionA to collectionB, then puts collectionB into a folder called "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