Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2022 by Barry MacDonnell. All Rights Reserved.

Page updated Jan 8, 2021

HILITE - a suite of macros for annotating or marking up drafts or other documents using highlighting:

HiLite.wcm - the computer equivalent of using up to 11 differently colored highlighter pens on a document

HiLiteDoc.wcm - highlight specific words in a document based on either [a] one or more words you input from an on-screen menu or [b] imported from a separate (saved) word list document

HiLiteNew.wcm - highlight text selections in a chosen color in the same document (similar to HiLite.wcm but useful to quickly access single colors from a toolbar or shortcut key)

HiLiteRem.wcm - remove all (or just some) highlighting from a document with an option to remove the underlying highlighted text

HiLiteRC.wcm - replace the color of existing highlights (either all highlights or specific highlights)

Download HILITE.ZIP (06/15/10; 92,586 bytes)

Compatible with WordPerfect 8 and later versions

WordPerfect 11 users: See important information about using macros in the first release of WP11 ( at the top of this page.

Downloading, Documentation, Modifications, and Support

See also -

HiLiteRL - Add highlighting to redlined text

"Customizing WordPerfect ..." Tips on how to create or modify a toolbar, keyboard, menu, etc.

Replace Codes - A macro to quickly change text attributes (e.g., bold, underline, italics, large size, etc.) by replacing, adding, or deleting a chosen attribute wherever it appears in the current document (can also replace a text attribute with highlighting)

Background notes and tips...

¤  Highlighting and highlighted are terms used in WordPerfect that refer to the result of applying a pair of special On/Off format codes ([Highlight(On)]..[Highlight(Off)]) around some text, which results in the text's background turning to a color. This format feature can be accessed with Tools, Highlight, On. (Some users have created a toolbar button for quick access to the Highlight On/Off feature) The effect is similar to adding (e.g.) Bold or Italics to some text (which also requires paired format codes), and it will be retained in the document when it is saved.
   This is an entirely different thing from what you see on screen when you simply select some text with mouse or keyboard and the text temporarily turns white on a black or blue background. No format codes are involved. It is merely a feature of Windows, not WordPerfect, and disappears when you click the mouse or press a key.
   This may be obvious to some users but the similarity between the two effects can confuse others when describing them in the same way — i.e., as "highlighted text". Hence, selected text in WordPerfect should be referred to as such (or with similar wording) to differentiate it from highlighted text. This can be particularly important when describing format issues or problems when you are working with others or seeking help on WordPerfect peer-support sites.

¤  WordPerfect has a manual highlight tool (but which is more limited than the macros below): Tools, Highlight, On (mentioned above). See the program's Help (F1) and search for "highlight". It's an On/Off toggle tool, which can also remove existing highlighting from selected text with Tools, Highlight, Off.

¤  Tools, Highlight, Print/Show must be enabled on that sub-menu to see or print highlighted text. You can turn it off temporarily if you want to print a document without the highlighting.

HiLite.wcm (v1.0) [Replaces the older HiLiteMenu.wcm macro]

Type some text ... highlight any block of text ... type some more ... highlight some more (even in a different color) ...

This macro immediately applies any one of several user-chosen highlight colors to one or more selected blocks of text, then returns the highlighting color back to the program's default of bright yellow (or any other user-preferred default color) when you dismiss the macro. This allows "marking up" many different selections of text as easily as using a highlighter pen on a paper document.

Basically, you need only -
play the macro to display a dialog (which remains on screen);
[2] choose a color (the default is green if you don't choose anything);
[3] select some document text (which immediately becomes highlighted);
[4] select some more text (which becomes highlighted);
[5] click the Done button on the dialog when finsihed. Or if you are in a document, press <Esc>. The program's current default highlight color (e.g., yellow -- but can be changed in the macro code: see tips below) will be restored as the macro exits.

Screen shot Screen shot of HiLite dialog (appears on the right side of your screen by default)

As noted, when you play the macro you can continually select various words or several blocks of text and the selections are highlighted almost instantly. You can change colors any time for different purposes, and you can even switch among open documents to highlight them, too!

There is also a choice on the menu, "Remove All HL," that will remove all existing highlighting in the document in one operation. (Sometimes this is useful even before you begin your own highlighting for the session, to "clean" it up. Whenever you use it, a warning message is given so that you can confirm this choice.)

You can always remove highlighting from individual items by deleting their [Highlight] codes in Reveal Codes.

Notes and tips

¤  While the macro is in use you can single-click once anywhere in the document to edit material in the document (i.e., type, delete, etc.).

¤  IMPORTANT: Selecting text while this macro is running will immediately highlight it in color and then selection mode for that block is turned off. So if you want to
select text to copy it or to perform some other selection-related task you will have to click on the "Done" button to stop the macro first.

¤  Adding the macro to a toolbar button will make it easier and quicker to access. See here for instructions.

¤  Be aware that the first thing this macro does is attempt to detect any codes inserted by the new WordPerfect X4 (and later version) Redaction Tool, whose formatting codes are a version of normal [Highlight] codes. Since applying normal highlighting—such as used by this macro—in the vicinity of redaction codes can be problematic, this macro pops a simple warning message that the redaction codes are present. [For more information on the redaction tool issue, see "WPX4 - Some cautions and tips when using the Redaction tool" at http://www.wpuniverse.com/vb/showthread.php?postid=183143#post183143 or the PDF version here]

¤ For complete instructions, tips, and notes, see the top of the macro's code. Click on Tools, Macro, Edit (which opens the macro file for viewing and editing).

Download HILITE.ZIP (full suite)

HiLiteDoc.wcm (v1.71)

Highlights words or short phrases (63 characters or fewer, including spaces) in a document based on -

•  up to 10 words/phrases manually entered via a pop up menu, or

•  a master list of words contained in a separate document.

An option on the first menu allows choosing from one of 10 highlight colors. (After playing the macro the highlight color is returned to your normal preferred color.)

Screen shot Screen shot of HiLiteDoc

Note that one of the options in HiLiteDoc ("Automatic - Use a search word file") requires a separate user-created WordPerfect document containing search words. Please see the simple instructions at the top of the macro's code (open the macro as a normal document or use Tools, Macro, Edit), or click on Help from the pop up menu.

Note also that one of the checkbox options on a secondary macro menu screen -- "Remove existing highlighting before processing" -- is enabled by default. This was designed to prevent confusion on which text was processed by the macro. (You can, however, select a different highlight color from the primary macro menu screen, then disable that option. This lets you have different highlight colors for pre-existing items and the items processed by the macro.)

Some of the macro techniques (for advanced users): (1) Employ a separate document file (*.WPD) from which to sequentially read short strings of data; then switch documents and search for the strings. (Employ menu entry fields to do the same thing.) (2) Use a help dialog in a menu, accessed via a push button. (3) Change information on a menu without using callbacks. In HiLiteDoc, the top half of the main menu changes according to a previous menu selection or if an "Other Menu" button is pushed on the current menu. (4) Write out information to a separate WPD file.

For complete instructions, tips, and notes, see the top of the macro's code. Click on Tools, Macro, Edit, which opens the macro file for viewing and editing.

Related: For WordPerfect X6 and later versions: See the Corel macro, Simple search and highlight.wcm, which does something similar -- but for just one search term at a time. And it only temporarily highlights the words/phrases it finds: When you dismiss its dialog ('X' on the dialog) the highlighting it applied is removed.

Download HILITE.ZIP (full suite)

HiLiteNew.wcm (v1.01)

Applies a user-specified highlight color to a selected block of text, then returns the highlight color back to the default (usually, bright yellow). This makes it easy to apply a different highlight color to certain text, but retain the default color when highlighting is next applied with the Highlight toolbar button.

Note: To be able to quickly apply any of several different colors, you need to use different copies of this macro -- one macro per color. See Tips below.

The WordPerfect program "remembers" which color was last used, so you can always reset the Highlight button's default color manually, but this macro makes it easier -- especially siince WordPerfect does not reset the default highlight color between sessions. You can modify the macro's next-to-last command to choose any default color.


☼  Several copies ("clones") of this macro, each with a different highlight color and each assigned to its own toolbar button or keystroke combination, allows the quick application of different highlight colors to various parts of the same document without impacting your default highlight color. (The included macro is set to apply bright green highlighting to selected text.)

☼  To make copies of the macro that will apply different highlight colors, see the instructions in the comment area at the top of the macro's code. (Just open the macro for editing with Tools, Macro, Edit. Make the required change per the instructions, and then click Save & Compile from the macro toolbar.)

☼  If you select the same highlighted item and play the macro again, the highlighting (only) will be removed. It acts as a "toggle" switch.

☼  To play the macro(s) with a toolbar button or keystroke, click here for instructions. To edit the default toolbar button's icon, click here (note the tip about using Corel Presentations to use a more extensive color pallette or create buttons with shading, fills, etc.).

☼  Here's an example of a "Highlighting" toolbar you could create yourself with Tools, Settings, Customize, Toobars, Create, then click Macros, Add Macro and add buttons/macros for each color. See the comments in the macro for more information. (Also see the "remove highlighting" TIP at the bottom of this column.)

Highlighting toolbar

For complete instructions, tips, and notes, see the top of the macro's code. Click on Tools, Macro, Edit, which opens the macro file for viewing and editing.

Download HILITE.ZIP (full suite)

HiLiteRem.wcm (v1.03)

Removes highlights and (optionally) removes the highlighted words. HiLiteRem also can be used to clean up documents containing comments, annotations, or other text that have been marked up with highlighting.

Screen shot Screen shot of HiLiteRem.

When you choose the menu option to "search for each item and prompt user with choice of action," a small dialog lets you (1) remove just the highlighting from the item, (2) remove both the highlighting and the highlighted text, (3) skip the item, or (4) quit the macro. This should make it easier to selectively edit a marked-up document.

Download HILITE.ZIP (full suite)

HiLiteRC.wcm (v1.05)

Replaces the color of existing highlighting in the document with a different color, either the current color that is specified on the WordPerfect toolbar (or Tools menu) or the color specified on the menu that pops up.

A menu option allows pausing to confirm individual replacements.

Screen shot Screen shot of HiLiteRC.

For modifications see the top of the macro's code. Click on Tools, Macro, Edit, which opens the macro file for viewing and editing.

Download HILITE.ZIP (full suite)

Related tips

☼  Do you often need to remove highlighting from a single highlighted word or section of highlighted text?

WP has a built-in "Remove Highlighting" feature that you can add to a toolbar as a new button.

The button will be active only if the cursor is directly on some highlighted text or if a selected block of text contains highlighting.

Here's how to add this feature to a toolbar:

    • Right-click the toolbar and choose Edit from the context menu. This will display the Toolbar Editor.
    • Under the Features tab, choose Tools from the "Feature categories" drop list.
    • Scroll down in the "Features" list and choose Remove Highlighting.
    • Click on the "Add Button" button. When the new button appears on the toolbar you can use your mouse to drag it to a new location.
    • Click OK, then Close.

CAUTION: If you use the Redaction Tool in the initial release of WordPerfect X4, here are some tips (click here for the PDF version) when using normal highlighting (Tools, Highlight) in the same document that is marked up for redaction (Tools, Redaction). Adjustments have been made to the above macros to alert you to the presence of these new codes.

☼  Do you need to print a document without the highlighting?

Click Tools, Highlight and de-select the option, "Print/Show". Enable this option following the print run.

Disclaimer, Distribution, and Privacy Policies

Page Top