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

Page updated Mar 6, 2013
COUNTTXT - Count specific words or other text strings

Download COUNTTXT.ZIP (v1.02; 03/06/2013; 7,447 bytes)

Compatible with WordPerfect 8 and later versions

Downloading, Documentation, Modifications, and Support

CountTxt.wcm - A macro that searches for and counts specific words or phrases in the document (e.g., the number of times your client's name appears).

This is another example of how to count text items using a search routine with a "loop-and-increment-counter".

Notes 

The macro language limits macro variable storage to 79 characters, including spaces. (See here for more.) This is the limit you can enter in the macro's pop up menu.

Hyphenated words (with [-Hyphen] codes) will not be found or counted.

Tip

You can also get a count of words using Edit, Find and Replace. Just use the same word in the Replace field that you use in the Find field. WordPerfect will give you a count of the replacements. (Of course, this method modifies your document, but you can always close it without saving it. Or you might be able to use Edit, Undo to restore it.)