Wednesday, September 21, 2011

Setting Up a Book Template Part 14

Today we're going to tackle a field code. You won't find much on using field codes. It's considered an advanced use of Word. However, once you understand how to use field codes, you'll find them to be a handy addition to your toolbox. We're going to start with a very easy field code: StyleRef.

We're going to add a StyleRef field code to make the title of the document (McKee Family Tree) an automatic field. Then, we are going to change McKee Family Tree to McKee Family Saga. When we make that change, Word will automatically update all references in your document based on the field code.

Going to Where We'll Add the Field Code
  1. Open a copy of your Genealogy Book template. If you need help, see Setting Up a Book Template Part 12.
  2. Scroll to page 10/30 (or ii). (Shortcut: Ctrl + G, enter 10, and click Go To.)
  3. Look in the header. This location is where you added the book title to the header. In my case, the title was McKee Family Tree. We're going to add a StyleRef based on the style Title.
  4. Double-click in the header area to open it. Your cursor most like is in front of the first word of the book title. If it isn't click before the first word.
Adding the Field Code 


  1. Display the Field dialog. For Word 2003 select: Insert, Field. For Word 2007/2010 select: Insert, Quick Parts (Text group), Field.
  2. In Field names, locate and select StyleRef. The Field Properties updates, showing the Style name field with a list of all styles used in your document.
  3. In Style name, locate and select Title.
  4. Click OK. Now you have McKee Family TreeMcKee Family Tree.
  5. Hold down the delete key to eliminate the second title (McKee Family Tree).
  6. Click anywhere in McKee Family Tree that remains and you'll find that Word adds gray fill because what remains is a field code.
  7. Save your document. Later, we'll save it as a template and replace your current template.
Because you have the headers set up with Same as previous, the field code cascades to all pages where the title was added to the header.

Seeing Why It Matters
  1. Click in the body of the page to close the header and scroll to the first page of the document (1/30). (Shortcut: CtrlG, enter 1, and click Go To.)
  2. Click in the title of your document and change the title of the book. I'm going to change McKee Family Tree to McKee Family Saga.
  3. Scroll to the title page. (Shortcut: Ctrl + G, enter 3, and click Go To.)
  4. Click in the title of your document and change the title of the book (Tree to Saga).
  5. Look again at your header. (Shortcut: Ctrl + G, enter 10, and click Go To.)
  6. Save your document. Later, we'll save it as a template and replace your current template.
Because you have the book title in the header set up as a field code, the title in headers update each time you change the title on the front cover and the title page. If you plan to use a field code for your title, you might want to:
  • Change the style for the book title (page 1/1) on the front page.
  • Make the title on the title page a field code.
Converting the Title on the Title Page
You can convert the title by:
  • Repeating these instructions to replace the typed title with a field code
  • Copy the field code from the header and replaced the typed title with the field code.
  1. Scroll to page 10/30 (or ii). (Shortcut: Ctrl + G, enter 10, and click Go To.)
  2. Double-click in the header area to open it.
  3. Click at the end of the book title in the header and press the space bar once to add a space at the end. The space will prevent you from copying the header style hidden in the paragraph mark you can't see.
  4. Run your cursor over the book title only, excluding the space and the hidden paragraph mark.
  5. Copy it. (Shortcut: Ctrl + C.)
  6. Double-click in the body to close the header.
  7. Scroll to the title page. (Shortcut: Ctrl + G, enter 3, and click Go To.)
  8. Click at the end of the book title in the header and press the space bar once to add a space at the end. The space will prevent you from copying the header style hidden in the paragraph mark you can't see.
  9. Highlight the book title on the title page, excluding the space and the hidden paragraph mark.
  10. Paste the field code.  (Shortcut: Ctrl + P.)
  11. Save your document. Later, we'll save it as a template and replace your current template.
If you get unexpected results, do you know why? Because you picked up the Header style when you copied.

Go to the cover and change the title again, and then check each place where the book title appears. You'll find that it changes each time in each place where the book title appears.

Seeing Field Codes Word 2003
  1. Display the View dialog...Select Tools, Options, and then click the View tab.
  2. Click the Field codes option  to add a check mark. Remove the check mark when you want to hide field codes.
  3. Click OK, and then save your document. Later, we'll save it as a template and replace your current template.
--OR--
  1. Use the shortcut: Hold down the Alt key and press F9.
  2. Here's what the field code looks like: {STYLEREF Title \* MERGEFORMAT}
  3. Look at a footer and you'll see a field code that looks like this: {PAGE \* MERGEFORMAT}
Seeing Field Codes Word 2007/2010


  1. Display the Word Options dialog...Select File, Options, and then click the Advanced option.
  2. Scroll to the Show document content group, and then click Show field codes instead of their values to add a check mark. Remove the check mark when you want to hide field codes.
  3. Click OK, and then save your document. Later, we'll save it as a template and replace your current template.
--OR--
  1. Use the shortcut: Hold down the Alt key and press F9.
  2. Here's what the field code looks like: {STYLEREF Title \* MERGEFORMAT}
  3. Look at a footer and you'll see a field code that looks like this: {PAGE \* MERGEFORMAT}
Next Post
We're going to set up the same type of field code for chapter titles. I want you to see the many uses you can have for a StyleRef field code.


No comments:

Post a Comment