Can I highlight the subject of a bookmark?

Q

Questions??

I was wondering if there is a way to enhance a bookmark, so that in addition
to jumping to the specific section chosen, the information contained in that
section would also be highlighted (i.e. the other areas dim, or the selected
area is marked in a fluorescent color)? I'm making a web page with a word
document and I think it might be helpful for my webpage viewers to see
exactly what I'm referring to, since otherwise they would have to know that
bookmarks always put info at the top of the page.
 
H

Helmut Weber

Hi,

hmm...

highlight a bookmark?

Well, if the bookmark "M1" looks like [bookmark], then

ActiveDocument.Bookmarks("M1").Range.HighlightColorIndex = wdYellow

Or am I missing the point?

HTH


Greetings from Bavaria, Germany

Helmut Weber, MVP, WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
Q

Questions??

Do I need to use the script editor? If so here is what I get:
<a href="#Bookmark_Location_Example">
Thanks for your help!
 
H

Helmut Weber

Hi
Do I need to use the script editor?

Probably very much so.
One could use a winwdowselectionchange-event.
See:
http://word.mvps.org/faqs/macrosvba/AppClassEvents.htm

and highlight the bookmark in the selection automatically
plus removing highlighting from all other bookmarks.

One could intercept the command Hyperlink.follow, I think.
If I only knew what the name of that command was!

Interesting question, maybe somebody else will jump in.
And a big challenge for someone, who asks, whether
the use of the script editor (better VBAIDE) would be necessary.


Greetings from Bavaria, Germany

Helmut Weber, MVP, WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top