Represents a document in a database.
Contained by: NotesDatabase, NotesDocumentCollection, NotesNewsletter, NotesUIDocument, NotesView, NotesViewEntry
Contains: NotesDateRange, NotesDateTime, NotesEmbeddedObject, NotesItem, NotesMIMEEntity, NotesRichTextItem
To create a new NotesDocument object, use one of the following:
Given a database, New creates a document in the database and returns a NotesDocument object that represents the document. You must call Save if you want the new document to be saved to disk.
Dim variableName As New NotesDocument( notesDatabase )
or
Set notesDocument = New NotesDocument( notesDatabase )
notesDatabase
The database in which to create a new document.
There are several ways to access an existing document.
Once you have a view, you can navigate to a specific document using methods in the NotesView class.
Once you have a collection of documents, you can navigate to a specific document using methods in the NotesDocumentCollection class.
After you create, modify, or delete a document, you must save the changes by calling the Save method.
If you don't call Save before the script finishes, all of your changes to a NotesDocument are lost. Call Save every time you want to keep your changes.
When you call Save, the document is saved to disk even if you don't add any items to it.
In addition to the properties listed, you can also treat an item name as a property of a NotesDocument object. For example, the following line of script sets the value of the Subject item in a document to "Hello":
doc.Subject = "Hello"
For more information, see the AppendItemValue and ReplaceItemValue methods.
A script attempts to decrypt an encrypted document the first time the script accesses one of the NotesDocument properties or methods. If decryption fails, an error is raised.