TITLE:      Placing a Document Filename in a Header or Footer
PRODUCT:    WordPerfect 5.1 for DOS 


Problem
You want the name of your document, including the path, to be
printed on every page of your document.


Concept
The Headers and Footers features of WordPerfect 5.1 allow you to
print the same information on each page.  You can create a macro
that will print the filename, then place that macro within a
header or footer.  The filename will then be printed in the same
place on every page.


Solution
Create a macro that will put the filename in a footer.

      Note:  Do not use this macro if the document already
      contains a Footer A.  If you do use this macro and you have
      already created a Footer A at the beginning of your
      document, it will be overwritten.  If you have created a
      Footer A later in your document, it will overwrite this
      macro.  You can change this macro to print in the header, as
      indicated after step 14.

1     Press Home, then Macro Define (Ctrl+F10) to start recording
the macro.

2     Type filename at the Define Macro prompt.

3     Type filename in footer at the Description prompt.

You are now in the Macro Define mode.  Every keystroke that you
make will be recorded in your macro.

4     Press Right Arrow once to move past the {DISPLAY OFF}
      command.

5     Press Ctrl+Page Up to list the macro commands.

6     Highlight {ASSIGN} and press Enter.

7     Type path~.

8     Press Ctrl+Page Up and type SY to search for the {SYSTEM}
command.  Press Enter once it is highlighted.

9     Type 15~~.

10    Press Ctrl+Page Up, press A to search for and highlight
{ASSIGN}, then press Enter.

11    Type name~.

12    Press Ctrl+Page Up, press SY to search for and highlight
{SYSTEM}, then press Enter. 

13    Type 12~~.

14    Press Format (Shift+F8), then choose Page (2), Footers (4),
Footer A (1), and Every Page (2).

If you want to place the filename within a header, select Headers
(3) instead of Footers (4).

15    Press Ctrl+Page Up, press V to search for and highlight
{VARIABLE}, then press Enter. 

16    Type path~.

17    Press Ctrl+Page Up.  {VARIABLE} should still be highlighted. 
Press Enter.

18    Type name~.

19    Press Compose (Ctrl+V), then press Exit (F7).

20    Press Compose (Ctrl+V) again, then press Exit (F7).

Your finished macro should look like this:

      {DISPLAY OFF}{ASSIGN}path~{SYSTEM}15~~{ASSIGN}name~
      {SYSTEM}12~~{Format}2412{VARIABLE}path~{VARIABLE}name~
      {Exit}{Exit}

21    Press Exit (F7) to stop recording the macro.

You are now ready to retrieve a file and run the macro.

To run the macro,

1     Press Macro (Alt+F10).

2     Type filename and press Enter.


See Also
    Macros, Macro Editor in the WordPerfect 5.1 for DOS
reference manual
    Headers and Footers in the WordPerfect 5.1 for DOS reference
manual
