| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
| Page updated Jun 3, 2018
|FILENAME STAMPING macros that put the document's filename and optional text on every page in the footer or header of your choice, or just on the last page of the document|
Macros with a similar purpose:
DocStamp - A macro that will toggle the display of a user-specified document text stamp—such as "DRAFT" or "COPY"—on and off.
EdgeText - a macro that places a short block of text, the date, and/or the filename at one of six places around the edge of the page, outside the page margins.
See also: QuickWords for another way to insert items in a document.
| Two macros are included in the download Zip file:
Purpose and advantages
FilenameStamper.wcm displays a menu (screen shot) when you play it.
Depending on your choices, it places the filename at the bottom of Footer A or Footer B, or at the top of Header A or Header B, starting on page 1. Footer A is used by default. If it exists the macro will edit it; if it does not, the macro will create it.
Thus you can use FileStamper in the same footer or header as other material. (See Operation below about issues with other headers or footers further in the document.)
Also, while WordPerfect ships with a macro (FileStmp.wcm) that puts the filename in a footer or header, it does not automatically remove old filename stamps the way this macro does. (See Footnote 1)
Other options are available on the pop up menu:
This macro stamps your documents with identification on just the last page (only) of the document.
1. FILSTAMP goes to the bottom of the current document and inserts two hard returns, then types the complete filename (drive and pathname), plus your initials or other indentifier such as "DRAFT COPY" (see the redlined User Modification Area in the macro's code to change the default identifier, etc.).If you make changes to the document, run FILSTAMP again to update the stamp.
The default file stamp -- printed in 7-point Arial -- looks something like this:
TipsC:\My Documents\Sample.wpd [DRAFT COPY]
☼ You can assign a macro to a menu, toolbar, or keystroke combination.
☼ You can use a file macro (i.e., one on your disk) as a template macro (i.e., embedded inside the template itself), and have it play whenever you print the document.
To do this, copy the file macro into the appropriate template and associate it with the PRE PRINT trigger, like this:
• Edit the template on which the current document is based. (See WP's online Help <F1 key> for more information.) When the template is open for editing, click the Copy/Remove Objects button on the Template Property Bar.
• In the Copy/Remove Template Objects dialog that pops up, select "Macros on Disk" from the Object Type drop list, then choose the name of the macro in the Source drop list.
• Click the Copy>> button, then click Close to close the dialog window. The macro should now be embedded inside the template as a template macro (as distinguished from a file macro -- i.e., one that is simply stored on your disk).
• Back in the template editing window, click the Associate button on the Template Property Bar. Click the Triggers radio button, then select Pre Print in the left window. In the Macros drop list, choose the name of the template macro and click OK. (You can always remove the associate with Pre Print by selecting No Association.)
• Save the template with File, Save. Test the operation of the macro by loading a new document based on the template, typing some text into it, and then printing it with File, Print.
If you need to edit the template macro later, while editing the template click on Tools, Template Macro, Edit.
Note also that the template on which all new documents are based (the "default" template) is named "Create a blank document," and is usually found in the Custom WP Templates section of your File, New from Projects list. On disk, the default template's filename is something like WP19US.WPT, where 19=WordPerfect X9, and US=the US language versions. For the actual location on your system, in WordPerfect click on Tools, Settings, Files, Template tab, and look at the data in the Default fields.
The FILESTMP macro that ships with WordPerfect is designed to place the filename in a header or footer -- both of which are "repeating elements." That is, they show up on every page until replaced or discontinued. Unless the cursor is positioned on the last page and no header or footer exists of the type (A or B) you choose, when you play the FILESTMP macro any existing header or footer will be modified (it's due to the way the macro is coded).
While it is possible to modify the FILESTMP macro's code to make the filename show up on the last page regardless of any existing header or footer -- as mentioned, new headers/footers "discontinue" previous ones of the same type -- it might be easier for you to use one of the macros above.
In particular, Filstamp.wcm makes the filename-stamping process more reliable, since it does not impact existing headers or footers -- which would be especially important if the user modified the document extensively, and then played the macro again.
Note that a macro is a WordPerfect file with a ".wcm" filename extension, and can be opened, viewed, and edited like an ordinary document. Most of the macros on this site have information or instructions at the top of the main macro code. Most have a redlined section in the macro's code that users can modify, something called the "User Modification Area." Follow the instructions there to modify various macro defaults, such as initial menu choices or initial values for the macro to use when it processes the document.