Secrets of the Office Masters: Custom Toolbars for Quick Highlighting

While working on this book, we regularly used Word's yellow and green highlighters to mark text for specific tasks and then cleared the highlighting when the task was complete. Because Word's Highlighter icon remembers the last color you select, this routine often takes two clicks—one click to display the drop-down list of available colors and a second click to select a color (or None, to erase highlighting).

To make highlighting a one-click process, we first created three nearly identical macros, using the following code:

 Public Sub NoHighlight() Selection.Range.HighlightColorIndex = wdNoHighlight End Sub Public Sub YellowHighlight() Selection.Range.HighlightColorIndex = ...

Get Special Edition Using Microsoft® Office XP now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.