"Ads by Goooooogle" links provided by Google.com, which has sole control over all advertising content it displays on this site.

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

Barry MacDonnell's
Toolbox for WordPerfect

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

Page updated July 24, 2007

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

Download INDEXLIST.ZIP
(v1.0; 07/24/07; 96,190 bytes, including a User Guide in PDF format)

Compatible with WordPerfect versions 9,10,11*,12,X3

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.

Unique - A suite of macros, information, and tips to help you index a document.


* - If you use WordPerfect 11, see information about using macros (from any source, not just this website) in the first release of WordPerfect 11 (i.e., build 11.0.0.233, as shown in WordPerfect's Help > About ...)

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 lease 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.)

INSTRUCTIONS

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; the list should start (and end) on its own page; and all items in the list should be kept reasonably short -- preferably less than 63 characters and spaces (500 maximum) per item.

Step 2. Back up the list (strongly recommended).

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

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. (See Step 2 above for a way to make this easy.) Then play the macro on the new list.

TIPS, NOTES, and LIMITATIONS

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.

Disclaimer:
All materials, including any software or software code contained herein, or that may be found on a related Internet site are offered without warranty or guarantee of any kind, either express or implied, including but not limited to implied warranties of merchantability, satisfactory quality, fitness for a particular purpose, non-infringement, or those arising by law, statute, usage of trade, course of dealing or otherwise, and are provided on an "as is," and "with all faults" basis. The entire risk as to the results and performance of these materials or software is assumed by you. The author assumes no liability whatsoever to you or any other entity or third party for any special, incidental, direct, indirect, or consequential damages -- including without limitation any damages to equipment, or for loss of profits, for business interruption, for loss of data or other information, or for any other loss arising out of the use or inability to use these materials, techniques, suggestions, or software programs, even if the author has been notified of the possibility or actuality of such damages, or they are foreseeable. Materials herein have been prepared with reasonable care for educational and informative purposes. No representations are made regarding the use or the results of the use of any materials contained herein in terms of their correctness, accuracy, reliability, or otherwise, and you are again cautioned that you use them solely at your own risk. You are advised to make backups of any important files before implementing any materials, including any macro, suggestion, tip, method, technique, or other item contained herein.


Footnote

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.