ReplaceItemValue method

Replaces all items of the specified name with one new item, which is assigned the specified value. If the document does not contain an item with the specified name, the method creates a new item and adds it to the document.

Defined in



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



Return value



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

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 change an item's value using the NotesDocument "extended class" syntax, which eliminates the need for ReplaceItemValue. 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 ReplaceItemValue, except that ReplaceItemValue returns a NotesItem object representing the item you just created, and the IsSummary property defaults to True.

Language cross-reference

replaceItemValue method in Java Document class

@SetField function in formula language

@SetDocField function in formula language

FIELD keyword in formula language

See Also