AppendRTItem - Method Not Available - Bug

Below is a good example of the problem. This is not my code but its simplifed for easy understanding. It is the same problem as I am having. You can not append/insert a RT item into another as the method Usage section in the Domino Designer describes.


Have experienced a strange problem with the AppendRTItem action on the NotesRichTextItem class.

The following code snippet is used in a shared action. When executed, I can successfully insert the text representation of the RTItem “Header”, but if I try to insert the RTItem itself, I get an error “Method is not available”. If I remark out the “BeginInsert”, both commands work correctly (although it’s inserted at the end, which I do not want).

Set header=settings.Getfirstitem(“Header”)

Set body=doc.Getfirstitem(“Body”)

Set rtNav=body.CreateNavigator

rtNav.FindFirstElement(RTELEM_TYPE_TEXTPARAGRAPH)

Set rtRange=body.CreateRange

Call rtRange.SetBegin(rtNav)

Call body.BeginInsert(rtRange)

'----WORKS----

Call body.AppendText(header.Text)

'----DOESN’T WORK----

Call body.AppendRTItem(header)

The Programming Guide Volume 2B: page 10-211

states "You can change the insertion point with BeginInsert and EndInsert.

Also AppendDocLink works with the BI and EI.

Subject: Could you try something…

And see if it produces the same results?Set header=settings.Getfirstitem(“Header”)

Set body=doc.Getfirstitem(“Body”)

Set rtNav=body.CreateNavigator

rtNav.FindFirstElement(RTELEM_TYPE_TEXTPARAGRAPH)

'— Comment out Set rtRange=body.CreateRange

'— Comment out Call rtRange.SetBegin(rtNav)

Call body.BeginInsert(rtNav)

'----WORKS----

'Call body.AppendText(header.Text)

'----DOESN’T WORK----

Call body.AppendRTItem(header)

Subject: RE: Could you try something…

I have spent the last 2 hours trying to get something similar to work. I am using the table cell navigator instead of a range. I get the same error. This method does not work with beginInsert.