Resetting the highlighter button

J

JC Home

I created a macro that highlights text as yellow, but now I every time I hit
the highlighter button, the text is highlighted with yellow no matter what
color was used last even though the last color does show up on the face of
the highlighter button. Any ideas of how to reset this so that the
highlighter button will highlight with the color shown on it?

Please feel free to copy me at (e-mail address removed)

Thanks!!
 
J

JC Home

Sub highlight()
'
' highlight Macro
' Macro recorded 7/6/2003 by Jeff Ciaccio
'
Selection.Range.HighlightColorIndex = wdYellow
End Sub

This is also assigned to a keyboard shortcut, but I don't know where that is
stored (but would love to if anybody knows)
 
J

JC Home

I guess the question I should be asking is where do the routines assigned to
the buttons get stored and how does one change that?
 
D

Dave Lett

Hi Jeff,

Have a look at the article " Intercepting events like Save and Print" at
http://www.mvps.org/word/FAQs/MacrosVBA/InterceptSavePrint.htm which details
how you can intercept Word's built-in commands. You have intercepted Word's
highlight command, which fires your routine regardless of the color you
select.

If you can, change the name of your routine:

Sub myHighlight()
'
' highlight Macro
' Macro recorded 7/6/2003 by Jeff Ciaccio
'
Selection.Range.HighlightColorIndex = wdYellow
End Sub

HTH
 
J

JC Home

If I change the name of the macro, will my hotkey still work? How about if
I simply want to assign a hotkey to do what a button would do? In this
case, how would I set a keyboard hotkey to act like I have used the
highlight button (with whatever color is currently selected)?

-Jeff Ciaccio
 

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