GetNthDocument (NotesView - LotusScript®)

Given a number, returns the document at the given position in the top level of a view.

Defined in



Set notesDocument = notesView .GetNthDocument( index& )



Long. A number indicating the document to return. Use 1 to indicate the first document in the view, 2 to indicate the second document, and so on.

Return value


A NotesDocument. The document in the specified position in the view. If there is no document at the specified position, returns Nothing.


This method accesses only top-level (main) documents in a view; response documents are excluded.

For categorized views, this method returns the first document in each main category only.

If you do not have Reader access to a document in a view, this method returns the next document that you have reader access to.

Using getNthDocument to iterate through a loop is strongly discouraged for performance reasons. See GetFirstDocument, GetLastDocument, GetNextDocument, GetNextSibling, GetPrevDocument, and GetPrevSibling for the preferred loop structure.