The information in this article applies to:
SUMMARYThe WordBasic FileName$() function returns the document file name and path. The following macro inserts the document name and path into your document window.
However, if the insertion point is positioned within a header or
footer, the document file name and path is not inserted. This occurs
because the header and footers in Word for Windows are treated as
separate windows from the document window. As a result, the FileName$()
function does not return the name of the document.
The following macros can be used as alternatives to using the FileName$() function. To determine the document name and directory, the macros access the summary information dialog box and extract the filename and directory information. Word for Windows adds the directory and filename together with a backslash between them with the following macro line:
The path and filename (C:\WINWORD\README.DOC) are inserted at the
position of the insertion point.
Word 2.0The following macro inserts the document file name and path into the document header.
In this macro, change the line "ViewHeaderFooter" to "ViewHeaderFooter
.type=1" to insert the information into the footer.
Word 1.xPosition the insertion point in the header or footer and run the following macro.
The document name and path are inserted at the insertion point. To
automate the process entirely, use the EditHeaderFooter command to open
the header or footer pane.
STATUSMicrosoft has confirmed this to be a problem in Word for Windows, versions 1.x and 2.x. This problem was corrected in Word for Windows, version 6.0. REFERENCES
"Microsoft Word for Windows User's Reference," page 96 Additional query words: 1.x 2.0 winword2 winword directory edit summary full complete location macword
Keywords : |
Last Reviewed: October 4, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |