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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.