automatically update field codes

S

Simone

I have inserted a SaveDate field code in a template. I
would like the field to update automaticcally when the
document is saved without having to F9 it or wait for
update when printing. Is there a formula of some kind that
will automatically update the field whenever the document
is saved?
 
D

Doug Robbins - Word MVP

Hi Simone,

The vba command

Assuming that the field is in the footer of the document, the easiest way to
get the fields to update is to preview the document. You can use the
following vba commands to do that

ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview

If you were to create a macro with the name

FileSaveAs that contains the following code

Dialogs(wdDialogFileSaveAs).Show
ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview

Then it would run whenever the File>Save As command is selected and should
do what you want.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top