Appending to rich text item

Hi,

I have to create a new Doc based on (an already stored) template Doc and modify the inherited Body rich text field. The copy method goes well, the new Doc gets all fields with the appropriete values but I just cannot change content in the rich text field.

I tried many ways, I always got the error message “Element or navigator is invalid” after trying to set RTNav.

Set Doc = TempDoc.CopyToDatabase(DB)

Call Doc.save(True, False)

Set RTI = Doc.GetFirstItem(“Body”)

Call RTI.Update

Set RTNav = RTI.CreateNavigator

Call RTI.BeginInsert(RTNav)

Call RTI.AppendText(“Value”)

Call RTI.EndInsert

Thank you for your help!

Regards,

Etyien

Subject: RE: appending to rich text item

It’s because you created the navigator but didn’t set it to any position yet.

Subject: appending to rich text item

You don’t show how your variables are declared. I’m not sure if this has anything to do with the problem but if RTI is a variant instead of a NotesRichTextItem, could that be causing the error when setting RTNav?