|
Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate |
| Toolbox for WordPerfect |
||
|
Macros, tips, and
templates for Corel® WordPerfect® for Windows® |
Page updated Oct 16,, 2024 |
|
| RevTotalPgs - Adds
or revises a text string in a document to show the total number of pages |
||
Related items - RevDater - Using the same general methods as RevTotalPgs (next column->), this macro "stamps" the current date (and, optionally, the time) in the currently open document at the cursor location. User customizable (custom text label, 5 date and time formats, optionally auto-save the document, etc.). PageNumb - Page numbering in WordPerfect (tips plus related links) |
Purpose and operation When you play RevTotalPgs.wcm it "stamps" the total number of physical pages in the document at the cursor location, along with your preferred text string preceding the number. [E.g., Total number of Pages: 35] Many users will find it useful to quickly insert (or update) this number in the document. Refreshing the total pages number is as easy as using the macro the first time: Just play it again — and the cursor can be located anywhere in that document, not just where the revision number is located. How it works First time:
When you play RevTotalPgs.wcm
the first time inside a WordPerfect document (or template, macro
file, etc.), the macro inserts the total number of physical pages 1 as a static text string of characters (not as a changeable code)
surrounded with a pair of surrounding bookmark
codes. For example, in Reveal Codes it should look something like this -
[*RevTotPgsAsText]Total Number of Pages: 75[*RevTotPgsAsText]
where "*" = the word "Bookmark: " (visible on mouseover)
Subsequent times:
The previously inserted bookmark codes allow the macro to instantly locate the entire bookmarked string in the
document, whenever you play the macro again to refresh (update) the enclosed
text string. [This a document-specific
operation, not a global one: Playing the macro affects only the current
document, not all open documents. Of course, you can play it in as many
documents as desired.]
Note:
Due to the way the macro was designed, only one such specially named bookmark string can be
inserted in the current document. (If you want it to display on multiple pages you can insert it
inside a repeating substructure like a Header, Footer, or Watermark
(more on these features here). Other bookmarks are not affected.
Tips ☼ If you want to remove and/or change the location of this special bookmarked string (if used) in a document:
Simply open Reveal Codes to see and delete either one of the pair of [Bookmark] codes surrounding the text string, and (optionally) the text string, too. Or just select the entire string — including the paired [Bookmark] codes — and press Delete. You then can (optionally) reposition your cursor in the document and simply play the macro again to produce a new, updated string. Note that you do NOT have to delete these bookmark codes and the text between them to update the text label (if used) and the total pages number. [See "Modifiations" below.] Just play the macro: it will locate the bookmarked string and do the updating, no matter where the bookmarked string is located in that document (even if it's inside a substructure such as a Header, Footer, Footnote, Text Box, etc.). ☼ For easy access to the macro you can add it to a toolbar (recommended), shortcut key, or menu. See here for more. Modifications You can modify the macro by opening the macro file (which is just a special form of ordinary WordPerfect document). See here if you need help.
In the redlined User Modification Area at the top of the macro code you can - • Change or omit the optional text label that precedes the number string (the default is "Total Number of Pages: "). • Optionally set the macro to show user messages (the default), or suppress them, during the macro's operation. • Optionally set the macro to automatically save the document after it adds/updates the revision date. If the document has not yet been saved, a Save dialog will appear. Note:
By design, this auto-save option is not available in templates (.wpt)
or macro files (.wcm), but the macro will still stamp (or revise) the
number of total pages
inside a macro file or template file while you are editing it. You can
then manually save the file (e.g., with File, Save or for macros with
Save & Compile on the macro toolbar).
|
|
| Notes |
1 [ Continued from above...] Some page numbering schemes change page numbers midway in the document. For example, Roman numerals for various "front matter" page numbers are often followed by Arabic page number "1" at the beginning of the main document. So the actual total pages that can be displayed via a Total Pages number code might not reflect the actual number of physical pages in the document. (You can manually get this count with File > Properties > Word Count (tab) > "Pages" while editing the document. However, the macro gets it directly when you play it.) |
|