LOTUSSCRIPT/COM/OLE CLASSES


NotesDocument class
Example

Represents a document in a database.

Containment

Contained by: NotesDatabase, NotesDocumentCollection, NotesNewsletter, NotesUIDocument, NotesView, NotesViewEntry

Contains: NotesDateRange, NotesDateTime, NotesEmbeddedObject, NotesItem, NotesMIMEEntity, NotesRichTextItem

Properties

Authors

ColumnValues

Created

EmbeddedObjects

EncryptionKeys

EncryptOnSend

FolderReferences

FTSearchScore

HasEmbedded

HttpURL

IsDeleted

IsEncrypted

IsNewNote

IsProfile

IsResponse

IsSigned

IsUIDocOpen

IsValid

Items

Key

LastAccessed

LastModified

LockHolders

NameOfProfile

NoteID

NotesURL

ParentDatabase

ParentDocumentUNID

ParentView

Responses

SaveMessageOnSend

SentByAgent

Signer

SignOnSend

Size

UniversalID

Verifier

Methods

AppendItemValue

AttachVCard

CloseMIMEEntities

ComputeWithForm

CopyAllItems

CopyItem

CopyToDatabase

CreateMIMEEntity

CreateReplyMessage

CreateRichTextItem

Encrypt

GetAttachment

GetFirstItem

GetItemValue

GetItemValueCustomDataBytes

GetItemValueDateTimeArray

GetMIMEEntity

GetRead method

GetReceivedItemText

HasItem

Lock

LockProvisional

MakeResponse

MarkRead

MarkUnread

New

PutInFolder

Remove

RemoveFromFolder

RemoveItem

RemovePermanently

RenderToRTItem

ReplaceItemValue

ReplaceItemValueCustomDataBytes

Save

Send

Sign

UnLock

Creation

To create a new NotesDocument object, use one of the following:


Note The New method is not supported in COM.
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

Dim variableName As New NotesDocument( notesDatabase )

or

Set notesDocument = New NotesDocument( notesDatabase )

Parameters

notesDatabase


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.

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.

Language cross-reference

MailSend @command in formula language

Example
See Also