How do I clear a rich text field?

I am trying to clear a rich text field in the querysave of a form but I"m having no luck. Is there some trick to setting a RT field to null? I’ve tried:

Call doc.RemoveItem(“GraphicLayout”)

Set rtitem = New NotesRichTextItem (doc,"GraphicLayout")

Call rtitem.AppendText("")

When I run in debug mode, it appears to be gone and then back with a null value. But when I go back into the doc, it’s still got the old data in it.

I have looked and looked on this forum and doing this is the only thing I can find to do.

Any help? Thanks.

Subject: How do I clear a rich text field?

No matter what you do in the back-end, the content of the editor will trump it when the UI document is saved. You’d need to use Source.FieldSetText(“GraphicLayout”,“”) to clear the editor.

Subject: RE: How do I clear a rich text field?

Bingo - that worked perfect!! Thanks so much for your help. Is this documented someplace because I spent hours today looking through the documentation and couldn’t find anything.

Thank you again.

Subject: RE: How do I clear a rich text field?

Documented, yes – documented as clearly as it could be, no.

Subject: How do I clear a rich text field?

I think you might need to use the uidocument. Have you tried the uidoc.clear method? Example from HelpSub Click(Source As Button)

Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

If ( uidoc.FieldGetText( uidoc.CurrentField ) <> “” ) Then

Call uidoc.SelectAll

Call uidoc.Clear

End If

End Sub

HTH

Subject: RE: How do I clear a rich text field?

to update rich text items the doc must be saved, closed then reopened

Subject: Do users need to see the field cleared?

If users don’t need to see the field cleared when they save the doc (e.g., when pressing Ctrl-S), how about deleting the rich text item and re-saving the document in the Queryclose event?