Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: file name autotext in footer update when name changed

9 views
Skip to first unread message

Suzanne S. Barnhill

unread,
Nov 7, 2006, 7:36:00 PM11/7/06
to
See “The FILENAME field does not automatically update when you open a
document in Word 2002 or Word 2003”
http://support.microsoft.com/?kbid=832897

Also the macro for updating fields at
http://gregmaxey.mvps.org/Field_Macros.htm

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"bpwilcox" <bpwi...@discussions.microsoft.com> wrote in message
news:4F06C33F-CB99-4588...@microsoft.com...
> Hi,
>
> I use the file name autotext in the footer -- is there a way to have that
> footer automatically update when we change the name of the document.
>
> When we update sales material we put a new date after the file name. It
> would be nice to be able to do a file/save as and have the footer update
with
> the new file name.
>
> Thanks,

Jay Freedman

unread,
Nov 7, 2006, 8:13:43 PM11/7/06
to
Add this macro to the template for the document (see
http://www.gmayor.com/installing_macro.htm if needed):

Sub FileSaveAs()
Dim oldOption As Boolean

oldOption = Options.UpdateFieldsAtPrint
Options.UpdateFieldsAtPrint = True

If Dialogs(wdDialogFileSaveAs).Show = -1 Then
Application.ScreenUpdating = False
' update all fields
With ActiveDocument
.PrintPreview
.ClosePrintPreview
.Saved = False
.Save
End With
Application.ScreenUpdating = True
End If

Options.UpdateFieldsAtPrint = oldOption
End Sub

It uses the fact that if the "Update fields" box is checked in the
Tools > Options > Print dialog, then switching to the Print Preview
will update all the fields in the document, including the filename
field. The macro makes sure that option is set. Then it shows the Save
As dialog; if you click the OK button, the macro quickly switches to
Print Preview and back again, and then saves again so the updated
fields are written to the disk file.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org


Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

bpwilcox

unread,
Nov 8, 2006, 12:21:01 PM11/8/06
to
Suzanne -- thank you for your help! I thought that the file name use to
update -- since I am now using Word 2002 and 2003 this explains why that no
longer happens.

I put in the suggested macron on one of my documents and it worked like a
charm. I assume I can do a "global" macro so all my word docs update.

Thanks! Bev

0 new messages