I have already several routines that works, to manipulate word documents through the OOO Api.
But when trying to reach a bookmark to insert a bmp image at its position, I can't reach propoerty of the bookmark or property of the cursor.
The exception message indicates "End of content node doesn't have the proper start node".
I have looked a lot on the web, among dozen of pages... but noway...
For exemple, it crashes with these two versions :
- here on the fisrt line (getAnchor or .anchor functions raise the exception) :
Code: Select all
Bookmark := FDocumentOpenOffice.Bookmarks.getByName(ABookMarkName).Anchor;
wCursor := FDocumentOpenOffice.Text.createTextCursorByRange(Bookmark);
FDocumentOpenOffice.Text.insertTextContent(wCursor, fShape, False);
- and here on the .getstart at the third line :
Code: Select all
wViewCursor := FDocumentOpenOffice.getCurrentController.getViewCursor;
wCursor := wText.createTextCursorByRange(wViewCursor);
wText.insertTextContent([size=150]wCursor.getStart[/size], fShape, false);
wText.insertTextContent(wViewCursor, fShape, false);