Changing highlight color - macro?

  • Thread starter Thread starter Anthony Giorgianni
  • Start date Start date
A

Anthony Giorgianni

Hello All

In Word 2000, I routinely need to use different highlighter colors within
the same document and thought I would create a macro to be able to change
the highlighter color quickly without having to use the color pull-down
menu.

I have been successful except for one thing: When I click on the macro
button I created on the toolbar, the highlighter color changes as I want BUT
the highlighter then turns off for some reason. That means I then have to
move the cursor over to the highlighter button and click it to turn the
highlighter back on - an annoying second step. If I try to incorporate this
step into the macro, it does not accept it. In fact, recording a macro that
ONLY turns the highlighter on appears not to work.

Is there a shortcut key combination or some other bit of code I can add to
my color-change macros to ensure that the highlighter either does not turn
off or is turned back on after the color is changed?

Thanks.


--
Regards,
Anthony Giorgianni

The return address for this post is fictitious. Please reply by posting back
to the newsgroup.
 
Oh here is one of the macros, incase this helps:

Sub Green()
Options.DefaultHighlightColorIndex = wdBrightGreen
End Sub

Whether I run this starting with highlight on or run it with highlighter
off, the highlighter is turned off at the end.


--
Regards,
Anthony Giorgianni

The return address for this post is fictitious. Please reply by posting back
to the newsgroup.
 
Could you show us the code you have produced so far? That would make it
easier to reproduce the problem and see what needs to be added.
 
Yes Jonathan - thanks. I posted the code as a follow-up. But I got it
figured out. What I did was assign a keyboard shortcut (overwriting F5 in
this case) to turn on highlighting. For some reason I could not get macro
recorder to record the keystroke either. So I manually entered it using the
VB editor and came up with this:

Options.DefaultHighlightColorIndex = wdPink
SendKeys "{F5}"

I made five of these and put colored icons on my taskbar next to the
highlighter button. I also made one for removing highlighting. To wit:

Options.DefaultHighlightColorIndex = wdNoHighlight
SendKeys "{F5}"

This works fine. I still can't figure why a simple
"Options.DefaultHighlightColorIndex = wdPink" should shut the highlight off.
Seems strange, since I did not include any command to shut it off.


Thanks again.


--
Regards,
Anthony Giorgianni

The return address for this post is fictitious. Please reply by posting back
to the newsgroup.
 
Back
Top