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-2024 by Barry MacDonnell. All Rights Reserved.

Page updated Jun 4, 2025

WORDLIST - Creates a separate list of words that appear at least once in the currently open document (or the current selection), sorted by frequency or alphabetically (or both)

Download WORDLIST.ZIP (version 1.0; 02/07/2012; 219,323 bytes; ZIP includes a  "readme" documentation file)

Compatible with WordPerfect X5+ and probably earlier versions back to WordPerfect 10. (Sorry, not for WP9 and earlier.)

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

Downloading instructions, Documentation, Modifications, and Support


Related pages -

•  Indexing documents with WordPerfect (manual and concordance methods)

•  Index Tools - Tutorials, macros, and tips to help you index a document

Two related functions to help with your writing style or indexing

The WordList.wcm macro creates either -

(A)    a frequency list of each of the words in the currently open document (or in a pre-selected block of text in the document), with duplicates removed, along with the number of times each item appears in the selection (i.e., its frequency of appearance);

- or -

(B)    an alphabetical list of each of the words in the currently open document (or in a pre-selected block of text in the document), with duplicates removed, but without showing the number of times each item appears in the selection. The list can then be manually edited to trim unwanted items (or clip desired items) to create a workable concordance file to help create an index for a document. (It can also serve to visually check for the misspelling of important words, since they will probably show up adjacent to each other.)

Creating a frequency list was the original idea behind this macro.

Creating an alphabetical list was included as a convenient way to create the initial draft of a concordance file you can use when indexing a document. Before using the macro to help create a concordance, see also the Recommendation and  Resources and Tips sections.

Compatibility

The macro was created in WordPerfect X5 and tested in X5/X6, but it should work in WordPerfect 10 and later versions (such as Wp2020 and WP2021). (A command used in this macro was not present in WordPerfect 9 and earlier. If you play it in such an early version it will pop up a warning message and then quit.)

This macro was written and tested in the U.S. English edition of WordPerfect. Other language editions might present problems for the macro (the author has no access to these editions, so your results using such an edition when playing this macro might not be optimal).

Strong recommendation

Please read the included documentation (WordList.wcm readme.pdf; 11 pages), since knowing how the macro deals with certain items will help you use it more effectively and let you what to expect from it. [Yes, it's a little time-consuming to learn about a new macro's operation -- but not as time-consuming as (e.g.) manually creating an alphabetized list with an item count or a draft of a alphabetized concordance file for a large document.]

The documentation covers topics such as: 

•  how the macro can sort a frequency list (alphabetical lists are always sorted in ascending order)
•  what is (and is not) processed
•  upper and lower case
•  what is considered a "word" by the macro (also: hyphenations and abbreviations)
•  how to exclude some items (and how to customize the items to exclude)
•  using alphabetical lists as concordance files to help index a document
•  how to make simple modifications to the macro's operation
•  related macros (see below), such as using Clipper.wcm to extract phrases from your document and add them to the list
For convenience, the same information in the included PDF documentation file is located in a comment area at the top of the macro's code. You can use Tools, Macro, Edit to open the macro file to view these comments.

Instructions and general operation


(1) Select a block of text in the body text area of the document -- or even the entire document (Edit, Select, All). Generally you will want to select several paragraphs or pages. If you do not select anything the macro will process the entire document. You should try it on a relatively small document first to see how it works, especially if you enable any of the menus' options (next step).

(2) Play the macro, and make your initial choice of the type of list from the first menu that appears. Click OK. A second menu will then appear, related to your first choice. Note that some options on this menu will differ depending on whether you wish to create a frequency list or a plain alphabetical list. Click OK again.

Screen shot 1: Screen shot Main WordList menu
Screen shot 2: 
Screen shot Frequency list sub-menu
Screen shot 3: 
Screen shot Alphabetical list sub-menu 

When the macro plays, one of the first things it does is to copy everything into a separate document window so that processing will not impact your current document. A small "Please Wait" dialog will appear to show the macro's progress. The final word list will appear in that separate document window so it can be saved for future use. (A summary of what was processed will appear above the listed words.)

N.B.:

Even though the macro does all processing in a separate document window, it is always a good idea to save your current work (and back up the target document) before using this macro or any other macro or program.

This macro needs to perform an unusually large number of functions (including code to account for words that might contain format codes such as hyphens), so some documents you play it on might contain some things that can cause the macro to fail (including with a WordPerfect crash). Reporta from users have uncovered (rare) issues where (e.g.) there were hundreds of "minor" words in the document (probably beyond what the computer could handle). These can be optionally excluded from processing (see the secondary menu screens #2 and #3 in the images above for this check box option), or (in one case) a large document was written entirely in French, which might have caused issues when sorting or listing all words, and caused the macro to fail. Hence, be sure to consider the "load" you might be putting on the macro if a crash occurs. (Another good reason to back up the document before playing this -- or any -- macro on it.) TIP: Test the macro on a small document first to see how it works. Also note that some things can be adjusted in the macro's code with simple settings: Open the macro for editing and view the comments and instructions at the top of the file. Also be sure to read the rest of this page so you know more about how the macro is supposed to work.

Speed of processing

To isolate individual words, then sort them and remove duplicates, several dozen steps must be taken by the macro. It can take anywhere from (normally) under a minute to (rarely) several minutes or more to process a document, depending on (1) the number of options you enable when you play the macro; (2) the length of the document; (3) your computer's processing speed; (4) the amount of available computer memory; etc.

Tip: Start with a small document or a small selection of text to see how the macro works before attempting large, complex documents.

Modifications to the macro's menus and/or the way it works

You can modify the default selections on the macro's menus and/or the way the macro works. See the "readme" file included in the download archive file. (This information is also included at the top of the macro's code: just open the macro like any WordPerfect document to view or edit it, or use Tools, Macro, Edit.)

¤  Update [Aug 26, 2013]: One of the things you can modify is the list of "minor words" the macro can exclude from processing. Currently it contains a master (reference) list of 239 items. However, there may be a limit to the number of items you can directly assign to an Array[] command. In WorPerfect X5 (released in 2010) this limit appears to be about 247 items, as noted here ... so the macro's reference list is nearly full (but you could delete some items to make room for others). Alternative: You can simply choose an option on either of the secondary menus that appears when you play the macro to exclude certain (short) minor words (or all those shorter than a specified number of characters) from processing.

Resources and tips


•  IndexDocs - Indexing documents with WordPerfect - The manual and concordance file methods - Tips on indexing - Creating a Glossary of Terms. [Highly recommended to read before using the WordList macro to create a concordance file.]

•  HSpacer - Converts normal space characters in selected text to hard spaces (same as manually using Ctrl+spacebar to insert a [HSpace] code) to join the selected words and prevent splitting up certain phrases, legal citations, etc., that should not "wrap" down to the next line at the right margin. Using hard spaces will also keep such items intact when creating the word list later.

•  Clipper - A macro that lets you select material in the current document (or any open WordPerfect document, even the WordList document) and automatically clip (i.e., copy or move) it to a separate temporary document. Clipped material is appended to that temporary document. A dialog remains on screen until dismissed to allow you to make multiple clips.

    Tips:

☼  If you enable the options on the Clipper menu to clip material as unformatted ("plain") text and to separate the clips by one hard return, you could create a list of special words and phrases by clipping (copying) them from any of your currently opened documents.

You could then add this "clipped" list to a previously edited (i.e., trimmed) Alphabetical list generated by the WordList macro to give you a comprehensive concordance file.

- or -

You can simply clip desired material directly from the WordList document into a new document that will, in turn, become your concordance file. This alternative might be easier and/or more precise for some users than block selecting and deleting material from that initial list to trim it of unwanted items. (Mass deletions can often produce mistakes.)

☼  The author's RemDupes macro might be helpful in removing duplicate entries from lists generated by Clipperor by some other method. [If the list is already sorted alphabetically (as with the WordList macro, RemDupes does that for you) you might only need to visually inspect the list to detect and manually remove duplicates.]

•  TrimTo63 - If you want to use an existing, plain alphabetical list as a draft of a concordance file you will want to trim the length on any long items to 63 characters (the WordPerfect-imposed limit) so you don't get an error later when creating an index using the concordance. Note that the WordList.wcm macro has an option to do this automatically at run time.

•  If you need multiple indexes in a document see Lindsay Rollo's Indexing.zip file. It "includes three macros and a PDF document (Indexes and Indexing.pdf) which outlines an approach to creating indexes; identifies alternative methods of selecting and marking index entries; demonstrates a technique for creating multiple indexes to any document; lists macros designed to assist indexing; and provides an example of a suitable index format."

•  For other indexing tools, see IndexList, IndxHead, IndxWord, ListWord, and PageLine.