Dynamic Autotext for Filename/path in Header/Footer

F

Fred Holmes

Word 2003.

I've used Insert Autotext: File name and path on the Header/Footer
toolbar to insert the full filespec into the footer of my document.
Unfortunately, the insertion is apparently hard text, not a field
code, and doesn't update when the the document is Saved As a
new/different filename. Is there any way to insert a field code in a
header/footer that will update to the document's current filename?

Thanks,

Fred Holmes
 
J

Jay Freedman

Fred said:
Word 2003.

I've used Insert Autotext: File name and path on the Header/Footer
toolbar to insert the full filespec into the footer of my document.
Unfortunately, the insertion is apparently hard text, not a field
code, and doesn't update when the the document is Saved As a
new/different filename. Is there any way to insert a field code in a
header/footer that will update to the document's current filename?

Hi Fred,

The AutoText is a Filename field, *not* hardcoded text. But it doesn't
automatically update when you change the filename with Save As. Never has
done...

Things have gotten worse in 2003, though, because the field used to update
when you reopened the document but it no longer does; see
http://support.microsoft.com/?kbid=832897.

You can use either of the approaches in that article (manually update the
field, or use an AutoOpen macro that updates all fields in all StoryRanges),
but that still won't immediately update the field on Save As. For that, you
need a FileSaveAs macro to intercept the Save As command, do the save, and
then update fields. You can use the same method as in the KB article, or --
assuming Update Fields is checked in Tools > Options > Print -- you can go
to Print Preview and back to Print Layout view. That will take care of the
Filename field, though it will miss some other fields such as TOC. See this
thread for sample code:
http://groups.google.com/[email protected]
 
Top