How to prevent fields from being updated — locked fields. Fields in headers and footers of documents Note that Word treats fields in the header or footer of a document differently from fields in the main body of document in relation to updating.
Most fields in the header and footer are updated automatically when you open a document. Fields in headers and footers are updated when you switch to Print Preview When you switch to Print Preview , all fields in the header and footer are updated. Fields in the main body of documents The rules that apply to how different types of fields update - cold, warm and hot fields. Fields 1. The rightmost column lists all fields of each kind.
This also means that a cold field includes nothing to be updated. Note that you must save the document to retain the results of automatically updated fields. Empty field. Empty field no name None -1 wdFieldEmpty Empty field. Acts as a placeholder for field content that has not yet been added. Type the relevant field code between the field brackets.
See the Microsoft article List of field codes in Word for information about the individual types of Word fields and their syntax. Press F9 to update the new field. Principles for getting access to the different stories in VBA Each story in a Word document may contain objects belonging to other stories.
Shapes — drawing objects — that can include text can also include fields All shapes that can include text can also include fields — and as fields elsewhere in a Word document, fields in shapes also need to be updated. Shapes can only be inserted in certain parts of a document If you try to insert a text box or another shape in e.
Overview of layers in a Word document — story types in VBA As explained above, the content in a Word document is spread across a number of layers, called stories in VBA. All the story type are members of the WdStoryType collection. WdStoryType Constant name.
WdStoryType Enumeration. Where is the story in the document. The main text in the document. Text in even pages headers. Text in first page headers.
Text in all other headers. Text in even pages footers. Text in first page footers. Text in all other footers. Text in footnotes. Text in the layer with the footnote separator. Text in the layer with footnote continuation separator. Text in the layer with footnote continuation notice. Text in endnotes. Text in the layer with the endnote separator.
Text in the layer with endnote continuation separator. Text in the layer with endnote continuation notice. Text in comments. Text in text boxes and other shapes. How to update fields Hot fields are updated automatically by Word as described above. Press F9 to update all fields in the selection. Alternatively, right-click and select Update Field from the context menu. If the selection includes one or more TOC fields, you will be asked once per TOC how you want the table of contents to be updated.
To quickly return to the previous view type, press Esc. METHOD 3 — Use a macro to update all fields in the entire document You can update all fields anywhere in the document in one operation using a macro made for that purpose.
Update All Fields macro - ready for use I have created a ready-for-use macro that updates all fields in the document no matter where they are found. How to make sure all fields are updated when printing If you turn ON the option Update fields before printing , all fields in the document will be updated when you print. How to stop updating fields before printing In general, a document you print should reflect the actual content of the document.
For more information, see Troubleshoot bookmarks. Insert fields. Field codes in Word. Create or update a cross-reference. Update a table of contents. Use a formula in a Word or Outlook table.
Create a table of contents. Need more help? Expand your skills. You could create a macro in your default template Normal. Sub UpdateAll Application.
PrintPreview ActiveDocument. ClosePrintPreview Application. Toggling print preview does not update all fields in the body of a document, so you need to update those separately. The following macro will do the job:. Sub UpdateAllFields Application. The problem is here, that it was easy before to update ALL fields in a word doc, including Body, Headers, Footers, contents etc. What they need is to run changes by real world people working in foreign countries to ask first. Depending on the type of field, another dialog box may appear where you can select other options this occurs for example, with a tables of contents.
Click the field and press F9. Update field appears in the drop-down menu when you right-click a field: Updating all fields in the body of a Word document To manually update all fields in the body of a Word document: Click in the body of the Word document.
Press F9. Updating fields in headers, footers or text boxes Some fields in headers, footers or text boxes must be updated separately.
To update fields in headers, footers or text boxes: Click in the header, footer or text box. Page fields do not need to be updated manually. Updating a table of contents field If you update a table of contents, another dialog box appears. Updating fields before printing or previewing You can set an option in Microsoft Word to ensure that all fields are updated automatically before previewing to preview, click the File tab in the Ribbon and then click Print : Click the File tab in the Ribbon and click Options at the bottom.
A dialog box appears. Click Display in the categories on the left. Scroll down to the Printing options area in the panel on the right. Ensure the check box for Update fields before printing is checked.
Click OK. The Word Options dialog box where Update field before printing has been checked appears as follows: Preventing field updating You can prevent fields from updating by locking them. Displaying fields with grey shading You can change your options in Microsoft Word so that all fields are displayed with grey shading the shading does not print. To display fields with grey shading: Click the File tab in the Ribbon and click Options at the bottom.
Click Advanced in the categories on the left. Scroll down to Show document content area in the panel on the right. Select Always from the drop-down menu for Field shading.
0コメント