Introduction:
This page is primarily about how to repeat data in a document using mapped content controls.
This can be relatively easy, or somewhat complex. This page is not comprehensive. It is based on things I
learned from Greg Maxey's pages. I wrote it because I frequently answer
questions on how to type information in one location in a document and have
it show up in other places as well.
Without Content Controls: If it is something that you want to have
in a header or footer to reflect the content of the page or section,
you should use a StyleRef Field. For repeating in the body of the document, if you are
using Word versions predating Word 2007, you should use bookmarks and REF
fields. In Word 2007 and later, though, I prefer
Content
Controls. For more ideas, see Greg Maxey's page on
Repeating Data (Populating Multiple Like Fields).
Macintosh Versions 2011
- 2021 (365) have a limited ability to use Content
Controls, but not to create or modify them.
If you are going to repeat information in multiple documents, you should
look at
Automated Boilerplate Using Microsoft Word and
Mail Merge.
There are at least two ways to repeat information in a document using
Content Controls. The easiest is to use the Document Property Content
Controls built into Word. This works for up to 15 separate items of plain text. The second is with Mapped Content Controls. (The document property
content controls are actually built-in mapped content controls.)
Custom Mapped
Content Controls are more flexible and there is no practical limit on the
number you can use. In addition, the document properties content controls
may only be useful for text while other kinds of mapped content controls can
have other kinds of data.
Document Property Content Controls
You can insert Document Property Content Controls using Insert > Quick
Parts > Text > Document Property. Here the same controls are shown in
Word 2010, 2019, and 2021. The Ribbon tab looks a bit different but these
Document Property Content Controls are on the Insert Tab under Quick
Parts.
There are 15 choices, some of which correspond to the summary document
properties. Here, though, we are not using them for that. We are using them
to repeat data. Fourteen are plain-text controls and the Publish Date
control is a Date-Picker control (but can hold plain text as well).
I recommend using Abstract, Publish Date, and Status first. Here is an
example:
This does not seem very useful until you see that you can modify these by
using the Developer Tab and choosing
Properties. That will let you change the tab at the top from "Abstract" to
whatever you want, i.e.,
"First Party Name".
Then you can use Developer Mode to change the placeholder text.
Remember to click out of Developer Mode when you are done. Once you have these
text changes made, you can replicate the information throughout
your document by using the same document property controls. If you insert
them directly as you did the first time, they will have their original
titles. However, if you instead copy and paste, you will get your new
titles. When information is changed in one location, it changes throughout
the document in the same document property content controls.
Here is the same thing with the fields filled in. When you
tab out of a content control after editing it, the same control changes
throughout the document.
Everything I know about doing this came from
this page by Greg Maxey in
Method 7 (Repeating Data (Populating Multiple Like Fields))
and my own experimentation. There are numerous ways
of repeating information in a Word context. This is only one of them. I urge
you to review Greg's page for more information.
Once you have modified these Document Property Content Controls for one
document, it is possible to save them for use in another by saving them as
Building Blocks.
The Document Property Content Controls are a special case of what are
called Mapped Content Controls. They are a special case because they come
already mapped in Word. They are the equivalent of plain text content
controls except the Publish Date which is a Date Picker Control. If you want the features of a different kind of Content Control,
you will have to map it to the document's XML directly. See this
Microsoft Answers thread on these content controls not picking up
formatting changes because they are plain-text.
The above information on Document Property Content Controls is an
exploration/expansion of Idea #7 in
Repeating Data (Populating Multiple Like Fields)
by Greg Maxey.
Here is a
sample
document showing a repurposed Publication Date Document Property
Content Control used in a Calculated Date field from
Paul Edstein's date calculation tutorial.
Here are videos on doing this repurposing:
It is possible to add properties (and related mapped content
controls) to this list. It is not easy. I explore
this later in this page.
More Mapped Content Controls (custom)
Please see
Repeat Text With Mapped Content Controls by Laura Townsend and
Mapped Content Controls by Greg Maxey for information on how
mapping works.
Frankly, I do not understand it nearly as well as Greg does. For those who
want the straight stuff from Microsoft, you can, instead, go to
Walkthrough: Bind content controls to custom XML parts.
I use Greg
Maxey's
Custom Content Control Insert Dialog or Graham Mayor's
Insert
Content Control Add-In these days for all of my custom
Content Controls (other than the built-in doc property controls) These
are free Add-ins that change the Developer Tab. Greg's can make all of the controls mapped by default. It
changes the Controls Group to Content Controls and Legacy Controls.
A different tool is offered by Graham
Mayor. It is also free. You can download that one here:
Insert
Content Control Add-In
Graham Mayor's Add-In adds the buttons to both the Developer and the
Insert Tabs.
Once
you have either installed, it makes using mapped controls even easier than
using the Document Property controls.
For more detailed control or to convert existing controls look at his
free
Content Control Tools©. You can download the utility from
this page.
Content Control Tools
It simplifies creation of a mapped content control. I know it works with
Drop-Down Lists, Date Picker, Picture and Plain Text. I assume that it works with the others as
well. Note the Word version limitation on mapping of Rich Text and Check Box controls. As with the Document
Property controls, once you have created one, you can copy it elsewhere in
your document to replicate data. As with the Document Property controls,
they are mapped so changing something in one location in your document
changes it elsewhere.
A somewhat simpler (and less comprehensive) tool is offered by Graham
Mayor. It is also free. You can download that one here:
Insert
Content Control Add-In
I use all three utilities and have them loaded as Add-Ins. For more on mapped content controls and many other ways to repeat information in a Word document,
see: Repeating Data (Populating Multiple Like Fields) by Greg Maxey.
Here is an example of using a Checkbox Mapped Content Control. There
is no Document Property checkbox.
This screenshot is from a document developed as an
answer in
this forum thread. The document with the sample checkboxes and
IF field can be downloaded from that thread.
Saving Modified Document Property Content Controls as
Building Blocks / AutoText
You cannot save and use any content controls as AutoText. Period.
(As of
Word 2021 what you get is text when you use the AutoText, not a content
control.)
If you save your custom mapped controls that are not Document Property Content
Controls in building blocks (other than AutoText) they will function as
content controls but do not retain their mapping when used in a
Global Template. If stored in a Document Template, mapping is
retained.
You can save altered Document Property Content Controls in Building
Blocks as Building Blocks other than AutoText. These will act as
mapped when inserted.
For instance, if you add a modified document property content control and
save that as a building block (not AutoText) then it will keep your
modifications but still function as a mapped control in a new document. I
recommend using Building Blocks that do not assume a particular position
(i.e. not a Cover Page, Header, or Footer). I tested with an Equation
Building Block and a Page Number Building Block (without position). Here
they are in Quick Parts. The links below
take you to an explanation of how this was created with links to the
template.
These altered document property content controls in the new document
remain mapped to that node in the new document.
Note that if the Content Control was the first thing on the page, it
seemed that it did not work to create the Building Block. This may have been
a problem with the entire Building Block not being part of the selection.
It is possible to have multiple Content Controls included in a single
Building Block. So, if you have a set of modified document property content
controls that you would like to be able to reuse, you could save them in a
single building block to be able to insert into a new document.
Many of the Cover Page Building Blocks and some of the other
building blocks use Document Property Content Controls.
See my answer to this question on Microsoft Answers and Stackoverflow.
Mapped Content Controls can be saved, and used as mapped content
controls in Building Blocks. How they can be used differs between
Document Templates and Global Templates. Global Templates can only
have repurposed Document Property Content Controls in building blocks to
be usable.
The advantage of the built-in Document Property Content Controls is
that they are all available under the Insert > Quick Parts > Document
Properties menu. If you create your own mapped controls and store them
as Building Blocks in a document template, you could place them in a
custom building blocks gallery and put a drop-down for that Gallery on
your Ribbon or QAT. See
Build & Deploy Custom Building Block Galleries by Greg Maxey. Here
is a
temporary link to a template I created with mapped controls stored
in the Quick Parts gallery as a proof of concept. That template was
developed in responding to
this question on Microsoft's Tech Community forum.
Macintosh Versions 2011 and later
Caveat, I have not used either of these Word versions. This information comes from
John Korchok, an experienced Mac Word user.
It is my understanding that while none of these has the ability to
insert content controls, mapped or otherwise, that most will work in these
versions. They have to be created using a Windows version, though. The Date
Picker Content Control does not work on a Mac.
I have compiled a .dotx template containing the document property content
controls that work in these Mac versions. Again, you can't edit any names
but they can be copied and pasted into documents on a Mac and will work as
mapped content controls within the new documents. For full function, be sure
to download the template to your computer rather than creating a new
document. Dotx
containing Content Controls for use on a Mac. Version 18.04
Here is a .dotx template that has them saved as individual AutoText entries.
Document
Property Content Controls AutoText. Version 18.01.
I recommend, instead,
creating templates in a Windows environments where these can be edited as
described above. However, I expect these samples will be of use to some users
who do not have access to Word in a Windows environment.
The Mac versions do use the built-in document properties discussed
below. I believe they can be reached by using File > Properties from the
Menu bar but may not be the mapped content controls but rather
Document Property Fields.
John gives information on
his website on how to create Content Controls using vba on the Mac.
Can the Quick Parts list of Document Property Content
Controls be Modified or Expanded?
Yes, but not easily, at least for me. I'm not sure yet how to do this.
Greg Maxey is exploring this in a Word Answers question:
Help with XML Schema. While it is not simple, here is a resulting
menu. "Client Age" "Client SSN", and "Typist (Initials Only)"
are additions that act like the other items built
into the list.
Both the SSN and Typist are subject to validation. See the
Answers thread for how.
See also Greg Maxey's
Enhanced Document Properties Add-In. It gives something similar. It
adds a menu for extra document property mapped content controls when it
is loaded. Those persist in a document or template as mapped content controls
so when inserted in a document or template
they retain their special duplication feature.
See my question on the Microsoft Answers site:
XML location of Document Properties in Quick Parts list
Here are screenshots from the document involved there. All of the custom
items in the properties list act as mapped content controls! They are
not all actually "document
properties." They will not show up if you use a DocProperty
field.
There are more! These can be added through SharePoint. I do not know
more at this time. As I figure this out (if I ever do) I will post
information here.
Microsoft Word has a number of built-in document properties and also allows
custom document properties. You can see these in Word 2007-2010 under File (Office
Button) > Properties > Advanced.