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 Nov 14, 2015

IndexList - A macro that produces an Index from an existing list of words or phrases in the document

(v1.01; 01/18/14; 94,564 bytes, including a User Guide in PDF format)

Compatible with WordPerfect 9 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

Related macros:

PageLine (for WordPerfect 9 and later) - A macro that produces Index entries that show both the page numbers and the line numbers for each entry. Some refer to this as a keyword index.

WordList - A macro that can create either a frequency list of each of the words in the document (or in a selection of text), or an alphabetical list of words that have been used at least once (which can then be used to create a concordance file for indexing a document).


This macro is designed to process a user-created list of words or phrases in the current document and place page numbers after each item to indicate where in the document the item was found. Thus, it creates an Index from the List.

Best of all, it can be used on multiple lists in the same document, thereby indexing each separately. It is fast, and requires nothing other than a typed (or inserted) list of words/phrases in the document itself. (You can create multiple Indexes in at least one other way; see Footnote 1.)

The list can be useful as a guide or "cue sheet" to others who might have printed copies of the document in hand ("Please refer to page ..."), or it can be used simply as a quick way of producing a guide ("Index") to certain key words in the document.

A "list" can be just a single item, or it can span multiple pages, though in the latter case you might want to use a concordance file and employ the built-in WordPerfect indexing feature. See here for more on creating a concordance and using it with the index feature.

While the IndexList macro is simple to use, the process differs from typical WordPerfect indexing methods, which use previously marked words in the main document and/or a concordance file to generate an Index. In those methods, you manually mark words in the document (with the Tools, Reference, Index feature), or create a comprehensive concordance list of words to be indexed. Then WordPerfect automatically creates the Index list of items with their page numbers when you generate the Index. This is an internal process.

With IndexList, you create a "source word" list first in the document itself. You simply type (or insert) a list of one or more words and phrases—usually, but not necessarily, at the end of the document—and play the macro with the cursor on the first word of the list. (Be sure to make a backup of the list first.) The macro will then use each item sequentially in a search routine to find the page number(s) where each item was found. It then types the page number(s) adjacent to the items in the list.

This is an external process, and as a result, the process is not totally automatic. (But then, neither is WordPerfect's indexing feature.)


For complete instructions see the included User Guide.

Step 1. Create the list of words and phrases following a few simple rules:

•  Each item on the list should be terminated with a hard return ([HRt]).
The list itself should be terminated with two hard returns.
Tthe list should start (and end) on its own page.
All items in the list should be kept reasonably short -- preferably less than 63 characters and spaces (500 maximum) per item.
•  Using hard hyphens (<Ctrl>+hyphen) in a word in the document requires using them in the word in the word list. [Tip: Use the same word twice in the list, one with regular hyphens and one with hard hyphens. For more on the various forms of hyphens in WordPerfect see here.)

[See the included User Guide for more information.]

Step 2. Back up the list to a separate document (strongly recommended).

Step 3. Place the cursor on the first item in the list, and play the macro.

Tips, notes, and limitations

☼  You can re-index the list, but unlike the WordPerfect indexing feature, this is not an automatic process. Here's why:

When WordPerfect generates an Index it uses codes previously embedded in the document (i.e., [Index] codes and/or [Hyperlink] codes) to locate the page numbers where the item is found.

When the IndexList macro creates an Index it uses a macro search function to find the actual words, and then report their page numbers in a new Index. It doesn't use indexing codes at all (but their presence will not impact the macro's operation).

Therefore: You cannot use the same list again "as is" since it now has page numbers in it. You must delete the page numbers first. (Step 2 above recommends making a backup of the list before having the macro add page numbers.) Then play the macro on the new list.

☼  You can use a macro such as ListWord to create a source list from the current document while you edit the document.

☼  Menu defaults and the "spacing" to be used between an index entry and the adjacent page/line numbers can be changed in the redlined User Modification Area at the top of the macro's code.

☼  This IndexList macro takes its page numbers from the internal (numeric) page number the cursor lands on when it searches for, and finds, words. Hence, if you number pages with Roman numerals (i,ii,iii,iv, etc.), an item found on "page ii" will show in the new Index as page 2, which is the actual, unformatted page number. (A menu option lets you skip introductory material by setting a starting page.)

However, if you change page number values later in the document—for example, if you want to renumber pages starting on page 4 (most often to change the page number's value to 1 using Format, Page, Numbering, Set Value)—then the macro will not be able to accurately report page numbers.

This is because the macro's numbering method differs from the one used by the WordPerfect Index feature. The latter uses special document "markers" ([Index] or [Hyperlink] codes) for each indexed word. These code markers are tracked internally and their page numbers (and current page format) are reported correctly even if page numbers are reset by you.

As a result of these differences, if you reset page numbers somewhere in the document and the macro detects the change when it starts, it will immediately display a brief message and then quit.

Therefore, you should only play the macro on a document where page numbering starts with "1" at the top of the document and is not reset somewhere later in the document.

☼  Always make a backup of your document before playing this (or any) macro. Although it will not impact the main document (it simply searches it), it will modify any existing Index entry area.



WordPerfect can create multiple indexes, too, based on a method worked out by Lindsay Rollo and posted here on WordPerfect Universe.

Basically, you should use just concordance files (see here) to create each Index, and NOT mark words for indexing with the manual method referenced above. Then you generate the first Index. Once generated, you select it AND its bracketing codes (i.e., select everything from the [Def Mark] code to the ending [Gen Txt] code) and temporarily turn the Index into a WordPerfect Comment with Insert, Comment, Create. This "hides" the Index so you can generate the next Index. Repeat as needed for more Indexes. When you have finished, "unhide" the hidden Indexes by placing the cursor immediately after each of the [Comment] codes and click Insert, Comment, Convert to text.

Naturally, all this should be done AFTER the final draft of the document, or you might need to delete the Indexes and recreate them to ensure all items appear with their proper page numbers.