I’m stumped by the problem of trying to insert a bookmark into a Text Table Cell in Writer.
Here’s what I’ve got so far:
oCell = TacTable.getCellByPosition(CurCol, CurRow)
DiagCursor = oCell.getStart()
… I can successfully insert text here
' Here is where we want to insert the bookmark if needed
If QLink Then
oCursor.gotoRange(DiagCursor.getEnd(), False)
oBookmark = ThisComponent.createInstance("com.sun.star.text.Bookmark")
oBookmark.setName("_Game_" & i)
ThisComponent.Cell.insertTextContent(oCursor, oBookmark, False)
End If
It all works fine right up to that very last line, which gives me this error:
“Text interface and cursor not related.”
I’ve tried a lot of different things here, such as:
ThisComponent.Text.insertTextContent(oCursor, oBookmark, False)
ThisComponent.Text.Cell.insertTextContent(oCursor, oBookmark, False)
ThisComponent.Text.insertTextContent(DiagCursor, oBookmark, False)
Nothing I try works.
Any help here would be greatly appreciated.