GetPrevSibling (NotesView - LotusScript®)

Given a document in a view, returns the document immediately preceding the given document at the same level. If you send the method a main document, the preceding main document in the view is returned. If you send a response document, the preceding response document with the same parent is returned.

If the view is categorized, the previous sibling must be in the same category as the original document.

Defined in



Set notesDocument = notesView .GetPrevSibling( document )



A NotesDocument. Any document in the view. If you specify Nothing, this method generates an error.

Return value


A NotesDocument. The document preceding the specified document, at the same level. Returns Nothing if there is no previous sibling in the view.


You can use GetPrevSibling to move from one main document to the next, skipping any response documents in between.

If you have filtered the view using FTSearch, GetPrevSibling returns the previous document in the view, regardless of level.


Two documents are siblings if:

  • They are both main documents, or
  • They are both responses or response-to-responses and they share the same parent document

The first sibling

GetPrevSibling returns Nothing when the notesDocument parameter is:

  • The first main document in a view
  • The first main document in a particular category of a view
  • The first response (or response-to-response) to a particular parent