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

Page updated Sep 24, 2014

WordPerfect Tips
Main tips page | Browse tips
Using WordPerfect counters You can use counters to count or number anything in a document. Counters can automatically display numbers, letters, or Roman numerals. They give you control over where numbers are displayed.
Tips -

Inserting counters more easily with a QuickWord (with an example)

Including counters in a style

Examples -

Using counters to automatically number table rows (or items) when you merge into a table

Using a two-level counter in graphic figure boxes (e.g., Figure 1.1, Figure 1.2, etc.)

Outline-in-an-outline. Use a counter inside a paragraph style for the first level, and a standard numbered Outline for the second level
Counter in a style - a macro approach

Create automatically numbered (or lettered) heading styles

(Macro:) Para#End - Numbers each paragraph at the end of the paragraph

Note that the following menu choices refer to the <WordPerfect> menu (right-click on the top menu bar for a choice of menu). If you use a <Microsoft Word> menu, the choices might be absent from your menu (but not from the program), or they might be found under another menu selection. See here for more.

Creating and using counters

To create a single-level counter:

  • Click on Insert, Other, Counter, Create.
  • In the "Create Counter Definition" dialog that appears, give the counter a name, (optionally) choose a numbering method (numbers, letters, Roman numerals) in the "Single level method" field, accept all other default values fields, and click OK.

While you can define several numbering levels, for most uses a single level will be sufficient.

To use the counter:

  • Place the cursor where you want the counter to appear (or "display") in the document.
  • Click on Insert, Other, Counter, select a counter, then click "Display in Document". In Reveal Codes you will see a new code: [Count Disp].
  • To increase or decrease the value of the next displayed counter, click on "Increase" or "Decrease". If you increase the counter, you will see a new code: [Count Inc].


    It is not recommended to use "Increase and Display" or "Decrease and Display," since the resulting codes can often be reversed from the order in which they should appear:
    [Count Disp] followed by [Count Inc]. Reason: You want to display a number, then cause it to increase (or decrease) the next time the counter is displayed further down in the document.


    To use counters inside a style, see the tip below.

Page Top

Tip: Inserting counters more easily with a QuickWord

[To use counters inside a style, see the tip below.]

You can create the two codes (explained above), then select them and create a QuickWord that will insert them both when the QuickWord is typed.

The following example (repeated on the QuickWords page for convenience), shows how to automatically and sequentially number items at the end of a phrase.

It also shows how two different sequences of numbered phrases can be interspersed and WordPerfect will still track their numbered phrases independently on one another.

Using text phrases with counters -
How to use a QuickWord to insert both

This technique works somewhat like an outline, where deleted or inserted items cause automatic renumbering of subsequent items. WordPerfect will keep the lists properly -- and separately -- numbered.

For example, suppose you want to create a set of automatically numbered phrases like this (colors are simply for emphasis but could, of course, be incorporated in the actual use) -

Interrogatory No. 1.
Did you ever ....

Interrogatory No. 2.
List the people within Division who ...

Interrogatory No. 3.
State where the manager told ....

Production Request No. 1.
Produce all records in the ...

Interrogatory No. 4.
Do you claim that Mr. X never ...

Production Request No. 2.
If your answer is Yes ...

... and so forth. Notice how the fourth and sixth item (in red) are numbered separately.

Here's how:

Step 1. Open a new, blank document. Create a single-level counter for each list item (e.g., one for Interrogatory items and one for Production items) with Insert, Other, Counter, Create, as explained above. Enter a name for the counter in the Create Counter Definition dialog that pops up, and click OK. When finished creating all counters, click Close to exit from the Counter Numbering dialog.

Step 2. In the main body of the document, type the leading text phrase and a space ("Interrogatory... "), then click Insert, Other, Counter. Choose the new, appropriate counter from the list and then click Display in Document. This takes you back to the main document. Make sure the insertion point is to the right of the new code in Reveal Codes. Then click Insert, Other, Counter, Increase.

You should now have two codes in the document,

    [Count Disp][Count Inc] -- in that order.

The idea is to make WordPerfect display the counter number, then (internally) increment it for any counter number that may follow later in the document. This should make it relatively immune from changing the number sequence if you copy, move, or delete such items.

Finally: Add a space, colon, hard left indent, etc., as desired to separate and/or format the text that will follow the two counter codes.

Step 3. Here's the part that automates everything:

Make a QuickWord out of the text phrase and the two codes (and any following spaces or codes) by using Reveal Codes to place the cursor just in front of (i.e., to the left of) the text phrase, and then use <Shift>+<RightArrow> keys to move the cursor to just after (to the right of) the end of the phrase and codes.

Now, with the phrase and counter codes and any formatting codes selected, click on Tools, QuickWords. Give the QW an easy-to-remember abbreviation, such as "\Int" (without quotes) for "Interrogatory."

Step 4. Repeat steps 2 and 3 for the other list item. Use the other counter, of course, and give the QuickWord a different name (e.g., "\Prod" [without quotes]).

Now, when you need the items, just type the QuickWord for them, plus a space, tab, or hard return. The QW will expand and the counter will number the item. You can add or delete a counter item, or insert a counter of the second type between a sequence of the first type, and WP will keep them properly -- and separately -- numbered.

Note that when you create QuickWords, you should make sure that the "Expand QuickWords when you type them" box is enabled, and the Option button's "Expand as text with formatting" is selected.

Also, QuickWords are stored in a special template on each user's (local) computer, where they can be managed, backed up, and replicated on other computers: see here for more.

Page Top

Tip: Including counters in a style

[To create a new (increasing or decreasing) counter, see above.]

Styles are just WordPerfect codes -- but codes that can contain other codes, text, graphics, headers, footers, comments, tables, table of contents markers, and -- you guessed it -- counters.

They act like containers to allow you to quickly apply consistent structure or formatting -- such as the Heading styles that ship with WordPerfect.

For an example of including counters in a style, here's a method designed for a user who needed to number paragraphs independently of a standard outline numbering scheme. That is, the user wanted to be able to independently number these paragraphs no matter what level of outline they appeared under. [This is just a commonly requested technique; however, you can use the method with any paragraphs, not just those inside an outline.]


First, create a single-level counter:

Step 1. Click on Insert, Other, Counter, Create. In the "Create Counter Definition" dialog that appears, give the counter a name, (optionally) choose a numbering method (numbers, letters, Roman numerals) in the "Single level method" field, accept all other default values fields, and click OK.

Next, create a style with the new counter in it, and save the style to your default or other template:

Step 2. Click Format, Styles, Create to open the Styles Editor. Give the new style a name and description. For "Type," choose "Document." (This is an open style that will remain in effect until the style is chosen again, at which point the number will be incremented. You can, of course, use a Paragraph or Character style. For more on styles see here.)

Step 3. Click in the Contents field of the Styles Editor. [Optional: You can add leading text characters, such as a word or number, to the left side of the two Counter codes you will insert in Step 4.]

Step 4. From the Styles Editor menu, click Insert, Other, Counter, and make sure the new counter is selected; then click the "Display in Document" button. Then repeat: click Insert, Other, Counter, and make sure the new counter is selected; then click "Increase."

You should now have two codes in the Contents field:

    [Count Disp][Count Inc] -- in that order.

The idea is to make WP display the number, then (internally) increment it for any counter number that may follow later in the document.

Step 5. Add a period (full stop), colon, space, or other "separator" character after the two codes. You can also add formatting to the codes (select them first), such as bold or italic, and/or add tabs (Insert, Tab) or hard left indents (Format, Paragraph, Indent) before or after the two codes.

Step 6. Click OK to return to the Styles dialog.

Step 7. If you want this style to be available to all new documents based on the default template, make sure the style is selected in the "Available styles" pane, then click the Options button, then Copy. Choose "Copy To: Default template," then click OK.

If you want the style available to other templates, it can be Saved/Retrieved -- or copied -- into them as needed. For example, once the new style is in the default template, editing any other template allows you to use the Copy/Remove Object button on the other template's property bar to copy the style from the default template into the other template.

Step 8. When finished, click Close to return to the document.

Step 9. Now, when you are using the main outline, toggle it off temporarily (usually, <Ctrl+H> or <Ctrl+T>; see here for more on this), then apply the new style. [If you are not using an outline, just apply the style where desired.]


You can select the new style code in Reveal Codes and make a QuickWord out of it to more quickly access it when typing the document. 

Or, record a simple macro (Tools, Macro, Record) that chooses and inserts the style, and assign the macro to a keystroke. [To assign macros to keystrokes, see here.]

Step 10. When you need a new number for a subsequent block of text, apply the style again; the internal counter will insert the incremented number. When you need to go back to your regular outline, toggle the outline on again, etc. 

You can insert new material, or delete the [Style] code, and the other items will be automatically renumbered.

Related Tips

  • You may want to create several new styles-with-counters, each with varying numbers of leading tabs or hard left indents to match the indentation of the levels of the main outline. Or, simply use tabs or hard left indents to line up under the current outline level before inserting the style.
  • You can write a macro to insert the style, using the macro command StyleOn("<stylename>"), where <stylename> is the name of the new style.
  • You can use a macro to create various styles-with-counters, as explained in the footnote on the Outlines page.
  • To cross-reference these counters:
    • Place your cursor just to the left of the [Style] code in the main document. For example, if you have created a Paragraph style with an embedded counter, you should see this string of codes wherever the style was applied; just place you cursor where indicated below:
      • [Para Style>*[Style]<Para Style]
      • * = cursor location
    • Click Tools, Reference, Cross Reference. In the Reference Tools dialog that appears, choose "Counter" as the Reference Type. The Counter dialog appears.
    • In that dialog, choose the custom counter you created in Step 1 at the top of this section (above), then click OK.
    • Back in the Reference Tools dialog, give the Target a name in the Select Target field, then click on Mark Target. A [Target] code will appear at the cursor location in the document, like this:
      • [Para Style>[Target][Style]<Para Style]
    • Repeat the above for your other Counter cross references until all [Target] codes are inserted in the document, adjacent to their [Style] codes.
    • Next, create your text references. Place your cursor at the appropriate location(s) in the text area of your document and create the reference(s) with the Mark button (not the Mark Target button) on the Reference Tools dialog. Before marking them, be sure the Reference Type is set to "Counter." Then set the Select Target to the appropriate target name for the current target.
      • Note: This step places a temporary "?" in the document, which will display the actual counter's number/letter when you generate the references.
    • Once finished creating your references ... click on Generate (or you can generate later from the Tools, Reference menu).
  • If you have created short Paragraph or Character styles-with-counters, you can have WordPerfect include these styles in a Table of Contents.

Page Top