例: GetPrevSibling method (NotesView - LotusScript®)

次のスクリプトは、データベースの [Main View] の最後から 2 番目の主要文書を検索します。

Dim db As New NotesDatabase( "Addis-Ababa", "discuss.nsf" )
Dim view As NotesView
Dim lastMain As NotesDocument
Dim secondToLastMain As NotesDocument
Set view = db.GetView( "Main View" )
Set lastMain = view.GetLastDocument
' Find the last main document in the view
While lastMain.IsResponse
  Set lastMain = view.GetParentDocument( lastMain )
Wend
' Now find the second-to-last main document in the view
Set secondToLastMain = view.GetPrevSibling( lastMain )