Examples: GetNextDocument method (NotesDocumentCollection - LotusScript®)

This script displays the authors of the second document in a collection.

Sub Click(Source As Button)
  Dim s As New NotesSession
  Dim db As NotesDatabase
  Dim dc As NotesDocumentCollection
  Dim docA As NotesDocument
  Dim docB As NotesDocument
  
  Set db = s.CurrentDatabase
  Set dc = db.FTSearch("Business",10)
  Set docA = dc.GetFirstDocument
  Set docB = dc.GetNextDocument(docA)
  Forall a In docB.Authors
    Messagebox( a )
  End Forall
End Sub