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.
Syntax
DimvariableNameAs New NotesDocument( notesDatabase )
or
Set notesDocument = New NotesDocument( notesDatabase )
Parameters
notesDatabase
The database in which to create a new document.
Access
There are several ways to access an existing document.
To get a document based on its position in a view, use a NotesView.
To get a document based on its position in a response hierarchy, use a NotesView.
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.
Saving changes
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.
Additional properties
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.
Encryption
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.