Hide Bookmark/Annotation anchors

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
User avatar
RoryOF
Moderator
Posts: 34611
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Hide Bookmark/Annotation anchors

Post by RoryOF »

Will some kind person please point me to the UNO structure to hide/display Bookmark/Annotation anchors?

Rory
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
FJCC
Moderator
Posts: 9271
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Hide Bookmark/Annotation anchors

Post by FJCC »

Sorry Rory, I am not sure what you are after. It looks like the anchor of a bookmark is just a text range, which would be visible in the ordinary way but it doesn't stand our from its surroundings. The text range could be selected with ThisComponent.CurrentController.select().
I suspect I am missing something obvious in your request. Is there a menu item that does what you want?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
RoryOF
Moderator
Posts: 34611
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Hide Bookmark/Annotation anchors

Post by RoryOF »

There is a menu item /View /Comments which will display or hide comments. I'm hoping to find the UNO component for that' I've seen a very old use - is it in OO 2? in some macro code by Hager et alia to show/hide bookmarks; this works, but is a very old reference, which I suspect may be dropped shortly.

I'm working on an application which will use Bookmarks to link to a database and would like to be able to display or hide these anchors.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
JeJe
Volunteer
Posts: 2779
Joined: Wed Mar 09, 2016 2:40 pm

Re: Hide Bookmark/Annotation anchors

Post by JeJe »

Dispatch command Resource ID symbol Resource ID value Mode Label value
.uno:ShowAnnotations SID_SHOW_POSTIT 11098 MTA Show Comments
.uno:HideNote FID_HIDE_NOTE 26672 MTA Hide Comment
.uno:ShowNote FID_SHOW_NOTE 26671 MTA Show Comment
.uno:NoteVisible FID_NOTE_VISIBLE 26630 MTA Show Comment

https://wiki.documentfoundation.org/Dev ... chCommands
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
FJCC
Moderator
Posts: 9271
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Hide Bookmark/Annotation anchors

Post by FJCC »

The API property that corresponds to View -> Comments seems to be in the ViewSettings of the CurrentController.

Code: Select all

ThisComponent.CurrenctController.ViewSettings.ShowAnnotations = FALSE
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
RoryOF
Moderator
Posts: 34611
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Hide Bookmark/Annotation anchors

Post by RoryOF »

Thanks, I'll play with these tomorrow and see how I get on.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
RoryOF
Moderator
Posts: 34611
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Hide Bookmark/Annotation anchors

Post by RoryOF »

I have most of my subroutines working OK. I'll try the above suggestions and when I get that sorted I'll start to integrate the subroutines into the overall app.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply