LOTUSSCRIPT/COM/OLE CLASSES


NotesItem class
Example

Represents a specific piece of data in a document.

In the user interface, Notes displays items in a document through fields on a form. When a field on a form and an item in a document have the same name, the field displays the item (for example, the Subject field displays the Subject item).

All of the items in a document are accessible through LotusScript, regardless of what form is used to display the document in the user interface.

Derived Classes

NotesRichTextItem inherits from NotesItem class.

Containment

Contained by: NotesDocument

Contains: NotesDateRange, NotesDateTime, NotesMIMEEntity

Properties

DateTimeValue

IsAuthors

IsEncrypted

IsNames

IsProtected

IsReaders

IsSigned

IsSummary

LastModified

Name

Parent

SaveToDisk

Text

Type

ValueLength

Values

Methods

Abstract

AppendToTextList

Contains

CopyItemToDocument

GetValueCustomDataBytes

GetValueDateTimeArray

GetMIMEEntity

New

Remove

SetValueCustomDataBytes

Creation

There are two ways to create a new NotesItem object:


Note The New method is not supported in COM.
Given a document, New creates an item on the document with a name and value that you specify. The data type of the item depends on the value you give it.

You must call Save on the document if you want the modified document to be saved to disk. The document won't display the new item in the user interface unless there is a field of the same name on the form used to display the document.

Syntax

Dim variableName As New NotesItem( notesDocument, name$, value
[, specialType% ] )

OR

Set notesItem = New NotesItem( notesDocument, name$, value [, specialType% ] )

Parameters

notesDocument


name$
value
specialType%
Usage

When you create a NotesItem using New, the IsSummary property of the item defaults to False, which means that the item value cannot be displayed in a view or folder.

Access

There are several ways to access an existing NotesItem object.


Accessing items directly from a document

For convenience, NotesDocument has methods you can use to access items without declaring a NotesItem object. All you need to know is the name of the item:


In addition, you can 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"

Rich text fields

NotesRichTextItem, which inherits the properties and methods of NotesItem, has additional properties and methods you can use to manipulate a rich text item.

Saving Changes

After you create or modify an item, you must save the changes by calling the parent document's Save method.

If you don't call Save before the script finishes, all of your changes to a NotesItem object are lost.

Example
See Also