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 = wdYellow End Sub Public Sub GreenHighlight() Selection.Range.HighlightColorIndex = wdGreen End Sub
We then created a new toolbar and assigned each macro to a button on the new toolbar, with a brightly colored icon and text label to clearly identify each highlighting option, as in Figure 2.20. (Note that this toolbar also includes buttons to add strikethrough formatting, show field codes, update field codes, and unlink field codes—all tasks that are difficult or impossible to do using Word's menus.)
Although you can't tell it from this page, the button next to each toolbar label is the same color as the highlighting choice. Creating the icons was simple—we started with the "happy face" icon and used the Button Editor to cover the inside of the face with the highlight color associated with each macro.
3.144.93.141