Repeatable Fields in Word
I often have to write up contracts or work agreements and have a few templates for this purpose. Microsoft Word has a field function where you can create fillable entries. The idea is that you lock the rest of the document down and can then give it to someone, letting them simply tab from field to field, filling out what you've laid out for them and you end up with a completed Word document.
That's nice but my need is just for internal use so locking the rest of the template down isn't a big deal to me. What I would like to do is once I fill out one of the fields, I'd like it replicated to other places in the document where that field appears. You'd think this would be easy but I've struggled to find good documentation on how to do this. Sure, there are plenty of instructions on setting up mail merge so you can generate many documents with different fields from a database or input file but that's not my goal either.
One example of what I need is at the top of a contract, I type the client's name. I want that immediately replicated to a spot on the signature page at the end of the document. I also want the contract number and date copied to the footer of each page of the contract. I finally took a little extra time and searched more thoroughly for an answer and finally found what I needed. It wasn't quite what I expected--and I'm surprised that this isn't simpler.
Basically, there are two ways to accomplish this. The hard way is to follow Microsoft's documentation and create custom XML parts and bind content to them. It requires Visual Studio with the Microsoft Office Developer Tools. While I'm a programmer and don't mind building XML schemas, this just seems like way too much work for my simple needs. I'd rather just type the replicated data a few times.
It turns out there are 15 of these XML parts already built in to Microsoft Word documents that you can use. Their purpose is to add meta data to the document such as Author, Category, Company, Keywords, and Publish Date but you can use them in your document as placeholders of your own custom data without any extra work. Since my contracts only need a few pieces of data replicated, this will work great!
Using Word's document properties to store your own data
Here's how you do it:
- Place your cursor at the point where you want one of these special pieces of data that will be copied to other places in your document.
- From the Insert tab in Word, drop down the Quick Parts menu, and expand the Document Property menu (see the screenshot to the right). That menu is the list of 15 XML parts (or Document Properties) that you can repurpose for your own needs. Some of them do affect the meta data of the document. For example, I was typing up a work agreement and used the Manager property for the person's name. After the document was saved, I looked at the properties for the document (right+click on the file in Windows Explorer) and saw the Manager property with the person's name I used in that document. This is not usually a big deal but something you should be aware of.
- Now that you have a place holder in your document to enter and store some text, you can add that same document property elsewhere in your document and it will show the same data. In fact, since they're linked to the same document property, updating either one will update the other immediately.
You might not like to see the names of these document property fields as they may not represent what you're using them for--you have to remember which document properties map to which of your purposes. But there's an easy way to change the "title" of these properties that show in your document (although they'll still be known by the original property name by Word). To do that, follow these additional steps:
- First, if it's not already, enable the Developer tab in Word.
- On the Developer tab, click Design Mode. When you do, all the document property fields you've added suddenly show up with big place-holder indicators (for lack of a better term) surrounding the property fields.
- Click on one, then click Properties in the Developer ribbon tab. Up pops a Content Control Properties dialog box with a place to change the Title.
- When you're satisfied, click OK and notice the control's title has changed. You can also change the prompt text if you wish.
Remember, after changing the title, it's still known by the original document property underneath so when you place another one further down in the document, you'll have to remember which document property you used previously to get the copied data. For example, in a Statement of Work, I used the Abstract document property to hold the Statement of Work number, or SOW. After changing the title to "SOW" (and the associated prompt text), there's no indication it's using the Abstract document property.
A few more things that may be useful to know:
- When the Content Control Properties dialog box is showing there, are two other boxes I often check for the additional copies of the document property fields I've placed. I like to do all the editing at the top of the document (the first occurrence of a field) and lock subsequent copies so I don't inadvertently change them. In the Locking section, the "Content control cannot be deleted" checkbox prevents me from accidentally deleting the text and the "Contents cannot be edited" checkbox prevents me from accidentally modifying it. These can be useful if you're deleting blocks of text and realize you included too many paragraphs in your selection list.
- Next to the Design Mode section of the Developer tab on the ribbon bar, you'll see a set of controls you can add to your document. These allow you to add additional fields that make it simple to create fillable forms as mentioned at that beginning of this article. I often place some of these on the forms for a couple of reasons: 1) they remind me of important pieces of data to include by making them stand out more than the surrounding text, and 2) I like adding the DatePicker as it's easier to select a date from a drop-down calendar than to type it in, plus, you can pre-select the format (from the Content Control Properties dialog) and it will type it all out for you.
Having found this information, I've updated several Word templates (.dotx files) and made my life a little simpler by stream-lining another repetitive process.