?
Solved

WORD 2010 FIELD CODE

Posted on 2011-05-03
4
Medium Priority
?
265 Views
Last Modified: 2012-05-11
When I insert a field code "filename" at the end of the document.  It does not update it with a new name or new version if I do "save as."  I did check the box stating "preserve formatting" but it does not change the stamp on the document.

Thank you.
0
Comment
Question by:miamiLAW
  • 2
4 Comments
 
LVL 7

Expert Comment

by:philip m o'brien
ID: 35516271
Word does not act like Excel, and automatically update fields. You will find it has updated when you next re-open but, if you want to see the change immediately you need to refresh it in some way e.g. use Ctrl+A to select all, then press F9 to refresh.
There are other ways to do this as well, for instance shifting to Print Preview and back and so on. Unfortunately SaveAs is not one of them.
Regards,
0
 
LVL 17

Expert Comment

by:wobbled
ID: 35696872
By default the only time a word document automatically updates field values is when you open it, besides that it is as SubVersion... posts above you need to select all and press F9
0
 
LVL 9

Expert Comment

by:lwebber
ID: 35706580
You can force all fields to update with a simple macro:

Sub FieldsUpdateAll
    ActiveDocument.Fields.Update
End Sub

You could assign it to a button on the Quick Access Toolbar, or assign a keyboard shortcut for it.
0
 
LVL 7

Accepted Solution

by:
philip m o'brien earned 2000 total points
ID: 35706908
Fair point, I'd avoided suggesting a macro option since it wasn't mentioned in the question as a preferred solution, but I agree that the code above would work fine.
If you want to be able to do this with all Word documents, not just the one in question, just remember to add the code to a new module in Normal.

To do this use the following:
Alt+F11
Click on where it says Normal in bold, then press
Alt+I+M
These three instructions will open the VBE and create a new module for you within the "Normal" project. Simply post the code from above into this.
Once done, to create a keyboard shortcut use these steps:
Tools>Customize>Keyboard
Scroll down to Macros, then select your new macro e.g. FieldsUpdateAll
Now highlight the box marked "Press new shortcut key" and enter your chosen shortcut key combination e.g. Alt+U
Click on Assign, Close and Close again

Now if you press Alt+U this will update all fields in your active document.
Regards
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question