例: GetPrevDocument method (NotesDocumentCollection - LotusScript®)

次のスクリプトは最後から 2 番目の文書を取得して secondToLastDoc オブジェクトに割り当てます。

Sub Click(Source As Button)
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Dim collection As NotesDocumentCollection
  Dim lastDoc As NotesDocument
  Dim secondToLastDoc As NotesDocument
  
  Set db = session.CurrentDatabase
  Set collection = db.FTSearch("Annual reports", 10)
  Set lastDoc = collection.GetLastDocument
  Set secondToLastDoc = collection.GetPrevDocument( lastDoc )
End Sub