Field Code basics

Video Contents

0:00 Placeholders for data-responsive automation

0:16 What you'll do

0:28 Set up the example in MS Word for desktop

1:07 Which keyboard keys to use to toggle field codes

2:11 Toggle field codes

2:51 Anatomy of a curly brace: field codes, switches

4:24 Mastering mail merges and data-responsive automations

5:11 Toggle back to normal (data value) view - don't get stuck!!

5:21 Course resources

5:36 Next stop: A course project!

Video Transcript

Did you know that every time you insert something like a page number, what you're actually adding is a placeholder for a tiny piece of data responsive automation? You might see something like Page 1 of 1, but, behind the scenes, there's some curly brace action going on that makes that happen.

In this video, I want you to get hands-on while I walk through how to use your own copy of Microsoft Word for desktop to toggle between these two views and understand what you're looking at, so you're ready to customize these things on your own.

So that you have something to play with, open a blank document in Microsoft Word for desktop and follow along with me. I think it's best to edit mail merge documents in Print Layout so that you can easily see how everything will be laid out on the final page. You can find and select that setting under the View tab of the Ribbon. And now insert some page numbering. On the Insert tab of the Ribbon, select Page Number, then Current Position, which will insert your page numbering where your cursor is. To maximize this example, scroll down to and select the option for Page X of Y, and you should now have a Page 1 of 1 where your cursor was.

To toggle to the behind the scenes view, you need to use a combination of keyboard keys. One of these is the F9 key. Which other keys you use is going to depend on what your F9 key looks like, so this can change from computer to computer. The F9 key should be at the top of your keyboard. If you have a picture on that key, take note of whether the F9 is on top or on the bottom. If the F9 is on top, or all you have is an F9 without a picture, you'll use the keyboard combination alt plus F9 on Windows, or, on a Mac, option plus F9. If you have a picture on top, that means your computer will probably assume you're only pressing that key if you want to do what the picture stands for, like search or adjust your screen brightness, so you'll have to add an extra key - the function key - to skip past that picture and use the F9 instead. So, if you have a picture above your F9, you'll use alt plus function key plus F9 on Windows, and option plus function key plus F9 on a Mac. Press those keys simultaneously to toggle to the behind the scenes view. Press those same keys again to toggle back to the normal view.

You'll toggle back and forth like this a lot as you design your templates, because this is how you'll move between editing the data responsive parts of your document, including any calculations and conditionals, and checking to see how it looks when your data has been inserted. If you've never done this before, take a second to pause this video so you can toggle back and forth a few times to get comfortable with this, and prove to yourself that you're not going to get stuck in the wrong view when you do this on your own. When you're ready, toggle to the behind the scenes view and press play on this video to move on to the next part.

So, you started with Page 1 or 1, but now, in the behind the scenes view, instead of the page numbers themselves you should now see curly braces that contain the words page and numpages. These are your data responsive placeholders. Formally, placeholders like page number are called field codes, and you use them wherever you have parts of your document that you want to change in response to new or different data. In this case, that data is information that Microsoft Word knows about your document, like what page this is and how many pages there are total.

Note that the words page and of from Page 1 of 1 are not inside curly braces, because they're going to stay the same regardless of what page you're on and what those numbers are. So, only the data responsive bits of your document are inside curly braces.

And the curly braces follow a pretty standard format. The first thing inside of a curly brace is the name of the field code, which is what tells Microsoft Word what you want it to do here. In this case, page stands for "get me the current page number and stick it in this spot,"and numpages stands for, "get me the number of pages in this document and stick it in this spot." Those curly braces might also contain something called switches, which are things like instructions about how to display the data that you've just stuck in that spot. In my version, I have a switch for Arabic, which means that I want to use Arabic numbers instead of Roman numerals for my numbering system, and I have a switch for something called mergeformat, which helps to preserve any formatting you've manually applied.

And that's pretty much all there is to it! Mastering the customized mail merge is really about becoming familiar with how and when to use the different field codes and switches, and particularly how to use them with your data set.

Page and numpages are just two of the field codes you can use. You can find a full list of the field codes under the Insert tab of the Ribbon. Look under Quick Parts, and then Field. When you create your mail merge templates for your own data, you'll rely heavily on a field code called mergefield, which is what lets you tie into the data columns in your own CSV or spreadsheet data source file. As we move through this course, you can insert field codes from this menu, but the focus will be on typing them in and customizing them for yourself, because that's actually faster in the long run.

To wrap up, toggle back to the normal view using the same keyboard combination as before.

Remembering which keys to use for this will become second nature to you by the end of this course. Until then, you can always find this information at the very top of the Quick Reference Guide located under Resources in the Welcome section of this course. It's listed there under its jargon name, which is Showing and Hiding Field Codes, which is what you've just done!

And with that, congratulations! You've taken your first hands-on step to creating your own powerful mail merge templates. That means it's time to start one of the course projects! I'll see you there!

Complete and Continue