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 Feb 24, 2024

REVDATER - Adds or revises a special text date in a document to show the current date

Download REVDATER.ZIP (v1.04; 08/11/23; 16,983 bytes)

Compatible with WordPerfect 9 and later versions

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, Documentation, Modifications, and Support


Related items -

RevTotalPgs - Using the same general methods as RevDater (next column->, this macro "stamps" the total number of pages in the document at the cursor location, along with your preferred text string preceding it.

User customizable (custom text label, optionally auto-save the document).



Purpose and operation

When you play RevDater.wcm it "stamps" the current date (and, optionally, the time) in the currently open document at the cursor location.

Many users will find it useful to quickly add (or update) a revision date in the document.

Refreshing that date/time is just 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 date is located.

How it works:

When you play RevDater.wcm the first time inside any WordPerfect document (or template, macro file, etc.), the macro inserts the current date as a text string of characters (not as a changeable date code) surrounded with a pair of bookmark codes (named RevDateAsText).

Bookmarks allow the macro to instantly find that text string in the document, whenever you play the macro again to refresh (update) that text string while editing that document. [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.]

Further, any relative font size, bolded text, etc., in effect at the revision date location should apply to the revision date, too.

[Note that due to the way the macro was designed only one such special 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).]


Modifications and tips

•  To customize the operation of the macro:

Open the RevDater.wcm macro file just like any other WordPerfect file. (For more help on this see here.)

You will find comments at the top (most of which you are now reading). Below them you will find the redlined User Modification Area where you can -

•  Change or omit the optional text label that precedes the date string (the default is "Revised:  ").

•  Set the macro to show or suppress user messages that display during the macro's operation.

•  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 or macro files -- but the macro will still stamp or revise the date in the macro file's code or template file's text.)

•  Set the desired format for the date (and if used, the time) to be inserted into the document.

You have five format choices, and three of them can be modified to your preferences.

[1] Standard system formatted date without the time:
        e.g.,  August 31, 2023
[2] Standard system formatted date with the system formatted time:
        e.g.,  August 31, 2023 - 2:15:38 PM
[3] Numeric formatted date (without the time):
        e.g.,  08/31/23 (user modifiable)
[4] Numeric formatted date (with the time):
        e.g.,  2023-08-31  14:15:38 (user modifiable)
[5] Numeric formatted date with the system time:
        e.g.,  08/31/2023  2:15:38 PM (user modifiable)

When you finish setting your preferences just click the Save & Compile button on the macro toolbar above the macro file's editing screen. (If you don't see it use File, Save.)

•  If you want to remove or change the location of this special date and time (if used) in a document: Simply open Reveal Codes to see and delete the pair of surrounding [Bookmark] codes and the date's text string (unless you want to retain the text string). It should look something like this:

[Bookmark> Revised: August...etc. <Bookmark]

Once these are removed, you can reposition your cursor in the document and simply play the macro again.

•  Note that you do NOT have to delete these bookmarks and the text between them to update the date and time (if used). Just play the macro and it will do the updating, no matter where the bookmarked string is located in that document.

•  In any document does NOT have those specially named bookmarks, playing the macro will immediately create a new pair of these bookmarks and insert the current date (or the date and time) between them. No special action is required on your part.

•  For easy access to the macro you can add it to a toolbar (recommended), shortcut key, or menu. See here.  


Version history -
v1.01 - (2002) Added code to visibly show the bookmarked item (by selecting the item) when if a final message displays.
v1.02 - (July 7, 2007) Revised code that removes the old date; now allows keeping the existing relative size attribute for the inserted revision date.
v1.03 - (June 23, 2016) Added code to detect if document has not yet been saved (if user wants to save document after revision date has been stamped in it). Updates to procedures and routines; added WP51CursorMovement() commands.
v1.04 - (Aug 11, 2023) Added user options to specify either a custom date (and, optionally, time) format to the stamp, or the original format -- such as August 11, 2023 (and, optionally, time). Added code to detect some incorrect settings in the User Modification Area. Corrected a small bug to deal with bookmarks being present but without text between them. Made several minor improvements to comments and messages.