I have a libreoffice macro to go to a certain bookmark ("qui")
sub vai_qui
ViewCursor = ThisComponent.CurrentController.getviewCursor()
Bookmark = ThisComponent.Bookmarks.getByName("qui").Anchor
ViewCursor.gotorange(Bookmark, False)
end sub
The problems are two:
- this is a libreoffice macro, and so it runs also with Calc and Base, and I'd like to avoid error messages in Calc and Base;
- With this macro the cursor go to the bookmark, but the focus of Writer is not on the cursor: I prefer to avoid this situation and have focus on cursor.
Thank you
As you have been told on LibreOffice forum***:
check for the document type
check for bookmarks existence
*** Cross-posting a question without any reference to other forums you asked for help is offending to the volunteers who spend their free time to help.