LOTUSSCRIPT/COM/OLE CLASSES


AppendItemValue method
Example

Creates a new item in a document and sets the item value.

Note In general, ReplaceItemValue is favored over AppendItemValue. If an item of the same name already exists in a document, AppendItemValue creates a second item of the same name, and the duplicate items are not accessible except through a work-around. If you are creating a new document, AppendItemValue is safe.

Defined in

NotesDocument

Syntax

Set notesItem = notesDocument.AppendItemValue( itemName$, value )

Parameters

itemName$


value
Return value

notesItem


Usage

To keep the new item in the document, you must call the Save method after calling AppendItemValue.

If the document already has an item called itemName$, AppendItemValue does not replace it. Instead, it creates another item of the same name, and gives it the value you specify.

The IsSummary property of the new item defaults to True, which means that the item value can be displayed in a view or folder.

"Extended class" syntax

You can also create an item in a document using the NotesDocument "extended class" syntax, which eliminates the need for AppendItemValue. For example, you have the following script:


You can achieve the same result by doing the following:
This syntax lets you treat NotesDocument as an "extended class" by using an item name as if it were a property of NotesDocument. In the example above, "Subject" is used as if it is a property of the NotesDocument class. The result is the same as if you used AppendItemValue, but note these differences in behavior:
Language cross-reference

appendItemValue method in Java Document class

Example
See Also