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,
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.
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