# Highlight bookmarks [closed]

Hi! I am using Zotero as a reference manager in Writer. To make my documents compatible with Word, Zotero offers the option to insert citations as bookmarks instead of fields. The problem I have is, I am working on a large document with contributions from many people, using different ref managers etc. when integrating these contributions the reference links normally break but the citation is still in the text. So I have now text with the citations I inserted properly linked to my Zotero and those of others just being text or fields with no connection anymore. It would be really helpful if writer would highlight bookmarked text so I could immediately see which citations will show up in the Bibliography and which are broken.

I know that you can navigate manually through bookmarks, but with hundreds of bookmarks this is not an option.

Please tell me that you can highlight bookmarks the same way you can highlight fields... PLEASEEEEE.

Cheers, T.

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by Tass close date 2018-07-09 18:13:15.179326

Sort by » oldest newest most voted

Enhancement request already filed : https://bugs.documentfoundation.org/s... You can comment this bug report to add your own proposition how to make bookmarks visible.

You should try this extension: https://extensions.libreoffice.org/ex...

more

Hey, thanks a lot. It looked good at the beginning but then it started to show 20 or more comment windows per bookmark making writer so slow that I already thought it had crashed. So this tool is only an option if there is really nothing else available. Still at least some kind of help, better than nothing.

( 2017-09-02 16:14:12 +0200 )edit

Hello @Tass,

Sub HighlightAllBookmarks( lHighLightColor As Long )
REM Highlights all Bookmarked text strings from the current document.
REM Example:  HighlightAllBookmarks( RGB(19,240,55) )
If HasUnoInterfaces( ThisComponent, "com.sun.star.text.XBookmarksSupplier" ) Then
Dim oBookmarks As Object
oBookmarks = ThisComponent.getBookmarks()

Dim sBookMarkNames() As String
sBookMarkNames = oBookmarks.getElementNames()

Dim i As Integer
For i = 0 To Ubound( sBookMarkNames )
oBookmarks.getByName( sBookMarkNames( i ) ).getAnchor().CharBackColor = lHighLightColor
Next
End If
End Sub

Sub HighlightAllBookmarks_Green()
HighlightAllBookmarks( RGB(19,240,55) )
End Sub

more

Hi, thanks a lot, wow, what a service! I tried it, opened the document in Writer, then the macro editor, copied all in, saved, ran it, got the following message: BASIC runtime error. Argument is not optional. and highlights this line: oBookmarks.getByName( sBookMarkNames( i ) ).getAnchor().CharBackColor = lHighLightColor

I have no clues about macros, last time I programmed something lies decades back, so sorry if I behave a bit dumb.

( 2017-09-02 16:04:29 +0200 )edit

When I run it outside the editor I get this message: A Scripting Framework error occurred while running the Basic script Standard.Module1.HighlightAllBookmarks. Message: wrong number of parameters!

( 2017-09-02 16:05:08 +0200 )edit

To call the above macro without argument:

Sub HighlightAllBookmarks_Green()
HighlightAllBookmarks( RGB(19,240,55) )
End Sub

( 2017-09-02 16:54:42 +0200 )edit

Hey, thanks! Returns now: BASIC runtime error. Sub-procedure or function procedure not defined. And it marks: HighlightAllBookmarks( RGB(19,240,55) ) But I also don't know if I copied it well, I made it to replace the first line of what you send me first.

( 2017-09-03 09:43:42 +0200 )edit

The second Sub does not replace the first Sub that i posted, but you need to have both Subs for this to work. ( both HighlightAllBookmarks and HighlightAllBookmarks_Green ).

I updated my answer to show them both together.

( 2017-09-03 10:42:45 +0200 )edit