If you have ever inserted a date or a page number into a Word document, you have used field codes. Despite their heavy use, many people are unaware of the full range of codes available. What Are Field Codes? A field code is “smart” text – once inserted, they can automatically update when needed. There are hundreds of field codes for various purposes, one of the most common being the codes for page numbers and the current date. Any time the information updates (a page is added, or the date changes), the field will automatically update.
You don’t need to see the actual field codes to insert and use these fields. Microsoft Word automatically hides the field codes and gives you a simpler way of viewing them. What Do They Do?
Field codes enable you to:. Build a document automatically in response to information provided by the user.
Insert information about the document into the document itself. Perform calculations. Produce complex numbering systems that go beyond the capabilities of the Bullets and Numbering dialog. How Do I Insert a Field?
There are two ways to insert a field code. The first way is, if you know the syntax, to press CTRL+F9 and enter the code for the function you wish to perform. Since most people don’t have these complex memorized, there’s another simpler way to do this!. Click on the Insert tab on the Ribbon. In the Text group, click Quick Parts.
Select Field from the drop-down menu. From the Field window, select your desired field on the left under Please choose a field. You can modify its display on the right under Field properties. You have successfully inserted a field! Common Field Codes Common field codes that are most useful include:.
Author: The author of the current document. AutoNum: Automatic numbering format, e.g. For numbered lists.
After you click the OK button, the field is inserted into your document. It looks like regular text, but it’s not: The field reflects some changing aspect of the document or other conditions, like the date and time. Many other commands in Word insert fields into a document, such as the Page Number commands. The field name must exactly match the field name in the header record. Specifies the text to be inserted before the MergeField field if the field is not blank. Specifies the text to be inserted following the MergeField field if the field is not blank. Specifies that the MergeField field is a mapped field.
Date: The current date. NumPages: The total number of pages in the document. Page: The current page number (hint: you can use “Page Page of NumPages” in your document footer to display something like “Page 1 of 3”). Title: The title of the current document.
Some of Words most powerful features are hidden from view, and one of these is field codes. While you may have encountered field codes when using mail merge, that's not the only task you can accomplish with field codes. In this article well look at how you can use field codes by themselves and in conjunction with bookmarks to create smart Word documents.
Let's see a field code at work. To begin:. Choose Insert Field. From the Categories list choose Date and Time.
From the Field Names list choose Date. Select the date format you want from the Field Properties list. Click OK What you see on the screen depends on your particular Word setup.
You may see todays date formatted in the style that you selected, or you may see a field code on the screen that looks something like this. A Click-Here block can be created using the MacroButton Word field. If you see the date rather than the field code, press the Alt + F9 keyboard buttons simultaneously to toggle between displaying field codes and the field code results. The field code you see is created inside a set of curly braces. While it appears that you could type the curly braces on the keyboard to create your own field codes this is not the case, and these braces are special characters that can be inserted only by pressing the Ctrl + F9 key combination. Another handy field code keyboard shortcut is Shift + F9 use this when you are positioned inside a field code to toggle between displaying the field code and displaying the results for this field code only.
To manage how Word displays field codes, choose Tools Options View tab. You can select whether field codes show in the document or not (disabling this is the preferable setting) and when to shade the fields: Never, Always or When Selected.
Selecting Always or When Selected may assist you in getting started with field codes and the shading won't display when you print the document. Click-Here Blocks One way to harness field codes to help create smart documents is to use them for Click-Here blocks. You click on these markers in your document to enter text. These boxes help ensure that text is positioned correctly, and they provide a useful prompt for the user. To make one Click an area in the document where you want people to type some text, and. Choose Insert Field. From the Categories dropdown list choose Document Automation.
From the Field Names list choose MacroButton and click the Field Codes button in the bottom left corner of the dialog In the Field Codes area you should see the word MacroButton followed by some text. Remove the text and replace it with the following text so the Field Code looks like this: MACROBUTTON ClickHere Type Recipient's name in here Now click OK. The ASK field sets up the bookmark you will use for entering text.
If you see the field code, press Alt + F9 so that you see just the prompt on the screen inside its square brackets. You can save this file either as a regular document or as a template. Open the file or create a document based on the template and ‑ to see how the click-here block works ‑ click the prompt and type some text.
When you do this, the field code disappears to be replaced by the text that you typed. The basis for this click-here block is the MacroButton field code that is typically used to run a macro.
However you can trick it into acting as a click-here block by typing a macro name that does not exist. The text you place in the square brackets is the prompt that will show on the screen. The square brackets are optional but they make the click here block look more professional. You can create multiple click-here blocks in one document use the same macro name and just change the prompt for each of them.