NotesDocument class


Represents a document in a database.

Containment
Contained by NotesDatabase, NotesDocumentCollection, NotesView
Contains NotesEmbeddedObject, NotesItem, NotesRichTextItem

Properties
Authors
ColumnValues
Created
EmbeddedObjects
EncryptionKeys
EncryptOnSend
FolderReferences 5
FTSearchScore
HasEmbedded
IsDeleted 5
IsNewNote
IsProfile
IsResponse
IsSigned
IsUIDocOpen
IsValid 5
Items
Key
LastAccessed
LastModified
NameOfProfile
NoteID
ParentDatabase
ParentDocumentUNID
ParentView
Responses
SaveMessageOnSend
SentByAgent
Signer
SignOnSend
Size
UniversalID
Verifier


Methods
AppendItemValue
ComputeWithForm
CopyAllItems
CopyItem
CopyToDatabase
CreateReplyMessage
CreateRichTextItem
Encrypt
GetAttachment
GetFirstItem
GetItemValue
HasItem
MakeResponse
New
PutInFolder
Remove
RemoveFromFolder
RemoveItem
RenderToRTItem
ReplaceItemValue
Save
Send
Sign

Access
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.

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.

If you create a new document using New, but do not add any items to it, the document is not saved to disk, even if you invoke the Save method.

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 on 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.

Examples
1. This script creates a new document in the current database, sets its Subject, and saves it. The document does not have a form associated with it; if a user opens the document in the user interface, Notes uses the default database form to display it.
2. This script creates a new document in the current database, sets its Form and Body items, and saves it. If a user opens the document in the user interface, Notes uses the Status form to display it (if a form by that name exists in the current database).
3. This script creates and mails (but doesn't save) a new document from the current database. It sets the Form to "Memo" so that its recipient can read it as a mail memo. The document is encrypted for Susanna Coil.