0
votes

I have a Rich Text field in Lotus Notes. But I am not sure how to clear the contents of the field.
I have tried the following:

  1. ReplaceItemValue:
doc.ReplaceItemValue("RichTextField", "")

ReplaceItemValue does not work for a Rich Text field.

  1. vRTItem.Values = "":

Set vRTItem = doc.GetFirstItem( "RichTextField" )
vRTItem.Values = ""

This didn't help.

  1. RemoveItem:

Set vRTItem = doc.GetFirstItem( "RichTextField" )
Call doc.RemoveItem("RichTextField")
Set vRTItem = doc.CreateRichTextItem( "RichTextField" )

But none of them worked.

2

2 Answers

1
votes

It would be helpful to see the all the code you've written and where this code is triggered (document event, button, agent, etc)

What you have should work but you need to save the document after you call those methods:

doc.Save(false, false)
0
votes

The "First" in the doc.GetFirstItem() method is a hint that there may be more than one.

I'd go with the doc.RemoveItem("theNameOfTheItem") : be sure to save the doc afterwards, before doing anything else with the doc.