I have written a LotusScript action to copy a rich text item, containing an empty table, from a pre-existing Notes document, append it to a newly-created rich text item in a new document, populate some of the table cells and launch the new document. The problem is that my code cannot 'see' the empty table in either document, yet when I launch either document, the empty table is there. I am trying to get a handle to the table via a NotesRichTextNavigator. The code snippet below runs fine in context but always results in the "Body field does not contain a table" message, even though I have confirmed via debugging that there is a valid handle to both the rich text item and the rich text navigator.
Dim rtnav As NotesRichTextNavigator
Dim doc As NotesDocument
Dim rtItem As NotesRichTextItem
..... 'Get handle to doc etc.
Set rtBody = New NotesRichTextItem(doc, "Body")
Set rtNav = rtBody.createnavigator
If Not rtNav.FindFirstElement(RTELEM_TYPE_TABLE) Then
Msgbox "Body field does not contain a table.",, "Error"
I have successfully created similar functionality years ago so I can't understand why it won't work in this situation. The table is definitely there, and is actually the only content in the rich text field, so why can't Notes see it via rtNav? I have also used the GetElementCount(rtNav, RTELEM_TYPE_TABLE) call which falsely reports there are 0 tables in the item. Has there been some change to this functionality between Notes 6.5 and Notes 8.5.3?
Cannot get handle to table in rich ... (Chris A Edwards... 11.May.16)
Feedback number WEBBA9UVWG created by Chris A Edwards on 05/11/2016
. . Solved it myself (Chris A Edwards... 12.May.16)