Word: Macro to Insert the Full Path and Filename of a Document

ID: Q83944


The information in this article applies to:
  • Microsoft Word for MS-DOS, versions 4.0, 5.0, 5.5, 6.0


SUMMARY

You can insert the full path and filename of your current file into an open Microsoft Word for MS-DOS version 5.5 document with the following macro:


<alt F><alt A><alt O><<set varone=field>><alt D><down>
   <enter><enter><alt N><<set vartwo=field>><alt O><<varone>>
   <enter><esc><<vartwo>> 
To insert the full path and filename of your current file into an open Word version 4.0 or 5.0 document, use the following macro:

<esc>ts<<set varone=field>>
   <esc><<varone>> 
Note: The opening chevron (<<) is created by pressing CTRL+[. The closing chevron (>>) is created by pressing CTRL+]. Single angle brackets ( < and > ) should be typed as displayed.


MORE INFORMATION

The above macros insert the filename and path at the current cursor location in your Word document. The File_Name macro in the MACRO.GLY file that ships with Word 5.5 inserts the filename only.

Additional query words: 4.00 5.00 5.50 file name

Keywords : kbusage
Version : MS-DOS:4.0,5.0,5.5,6.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 20, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.