Publish Date and mapped content controls in Word


Each Word document has various hidden data fields and some are called mapped content controls.  They let you set some text or date in a document which is automatically repeated any other place in the document that has the same control.

Mapped Content Controls are an alternative to other ‘repeating text’ options like Bookmarks.  The big advantage is that you can change any appearance of the control and it’ll be updated in the other controls automatically.  No need to jump to a ‘master’ bookmark or find a document property in File | Info, just change the control in the document itself.

We won’t deal with the details of mapped content control here.  We’ll focus on a single example, Publish Date and how you can adapt it to other date related needs.

At Insert | Document Property there’s a date option called Publish Date.

This ‘Publish Date’ is saved with the document and stays the same until you change it manually.

Unlike Create, Save or Print date fields/properties, Publish Date is set by the user, not by Word.

To setup first insert the Publish Date control, it appears blank. Type in a date or click on the pull-down to see a date selector.

Other places in the same document can also have the Publish Date document property.  Change the Publish Date in one place and it’ll change in all the others automatically.

The obvious use for this is setting the actual Publish Date of the document, contract, agreement or whatever but it’s not limited to that.

Change the name

It’s called ‘Publish Date’ but it can be used for any date and time purpose you want to repeat through the document.  Just rename the Publish Date control to any other name you like.

This shortcut only works if you do NOT want to use ‘Publish Date’ itself in the document.

Insert a Publish Date control, select it, then go to the Developers tab and choose Controls | Properties.  If there’s no Developers tab, go to Customize Ribbon and select it from the right-hand column.

The mapped control dialog has many options, but the main ones are:

Title:  rename the control to any name you like.

Tag:  a longer explanation of what the control is for.

Date Format:  select from the available options or make your own.  Use the same date/time formatting options as for fields.   The above example has a custom date/time format showing date and time down to the second.

Bounding Box: change the way the control looks in the document as it’s edited.

  • Bounding Box with a label above.
  • Start/End tag an ‘XML like’ look
  • None

The bounding box doesn’t appear in the printed document.

Only one ‘Publish Date’ per document

You can’t change the name of a Publish Date control and have a ‘real’ Publish Date in the same document – they’ll both show the same date/time.  Even though you can change the visible name of the Publish Date property, it’s still a document property and there can be only one of each.

Nerd Note: In the document XML, the visible name of Publish Date property is called an alias.

<w:alias w:val="Incept Date"/>
<w:dataBinding w:prefixMappings="xmlns:ns0='http://schemas.microsoft.com/office/2006/coverPageProps' " w:xpath="/ns0:CoverPageProperties[1]/ns0:PublishDate[1]" w:storeItemID="{55AAAAAA-3C7A-41E3-B477-F2FDAAAAAAA}"/>
<w:date w:fullDate="2018-09-12T00:00:00Z">
<w:dateFormat w:val="ddd d MMM yy"/>

Warning

File | Info | Inspect the document will remove document properties, the Publish Date among other properties will be converted from dynamic properties to text.


Want More?

Office Watch has the latest news and tips about Microsoft Office.  Delivered once a week.