Collecting all documents and all unprocessed documents

The AllDocuments property of the NotesDatabase class is a NotesDocumentCollection object that contains all the data documents in a database. The UnprocessedDocuments property applies only to agents and view actions. For agents, this property contains all documents not yet processed by the agent or the result of the search specified in the agent's Document Selection object, depending on how you create the agent. For view actions, this property contains all selected documents. Use GetModifiedDocuments in NotesDatabase to get documents modified since a specified time.

The NotesDocumentCollection class has the following properties and methods for accessing documents:

  • Use the GetFirstDocument and GetNextDocument methods to get the first and next document in a loop until the next document is Nothing.
  • Use the GetLastDocument and GetPrevDocument methods to get the last and previous document in a loop until the previous document is Nothing.
  • Use the Count property to get the number of documents in the collection.
  • Use the GetNthDocument method to get a particular document.

The documents in a document collection are not ordered.

The NotesDocumentCollection class contains the following properties:

Property

Data type

Description

Count

Long

(Read-only) Number of documents in the collection

IsSorted

Boolean

(Read-only) True if the documents are sorted

Parent

NotesDatabase

(Read-only) Database that contains the collection

Query

String

(Read-only) Text of the query that created the collection

UntilTime

NotesDateTime

(Read-only) Database end time for a collection made through GetModifiedDocuments in NotesDatabase