| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
| Page updated Nov 14, 2015
|IndexList - A macro that produces an Index from an existing list of words or phrases in the 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]).
[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:
☼ 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.)
☼ 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.