LOTUSSCRIPT/COM/OLE CLASSES
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
NotesDocument
Syntax
Set notesItem = notesDocument.ReplaceItemValue( itemName$, value )
Parameters
itemName$
Note ReplaceItemValue method takes the NotesDateTime object as input directly.
notesItem
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.
Do not use this method to replace the value of a rich text item (or MIME entity) unless you want to change it to a text item. To replace the contents of a rich text item, use NotesDocument.RemoveItem or NotesRichTextItem.Remove to delete the old item, NotesDocument.CreateRichTextItem to create a new one with the same name, and NotesRichTextItem.AppendText and other methods to provide the new content.
"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:
While this syntax may be adequate for one-time scripts, you should prefer ReplaceItemValue because:
replaceItemValue method in Java Document class
@SetField function in formula language
@SetDocField function in formula language
FIELD keyword in formula language
Example See Also