How to create smart document templates with embedded metadata

This page explains how to create “smart” documents templates in Microsoft Word, using quick parts, to display document metadata from SharePoint inside the actual document, e.g. the page header/footer, e.g:
Document metadata displayed on a page header
To add an embedded metadata, follow these steps:

  1. Add the site columns that should be added as metadata, to the document template library (see instructions on this page, under section 2).
  2. Open a Word document from the document templates library.
  3. Place the marker in the document where you want to add the quick part.
  4. Select the “Insert” tab in Word and, in the “Text” section, then “Quick Parts” and depending on which metadata you want to add, you either select “Document Property” (for all custom columns and certain word properties) or “Field” (for certain standard SharePoint columns):
    Inserting Quick Parts
    In the section “Standard SharePoint columns as embedded Metadata” bellow, you will see which quick parts to choose, for standard SharePoint columns.
  5. Select the appropriate quick part.
  6. If needed, format the inserted quick part (font, font size, color, etc.).
  7. Save and close the document.
  8. New documents that are created from the template will now contain the Quick Part (metadata).

Standard SharePoint columns as embedded Metadata

A standard document library in SharePoint, by default, always has these built-in metadata:

  1. Name
    1. “Name” is the document’s name, including its file-extension.
    2. It can be added as an embedded metadata in documents, by inserting the “FileName” Field Quick Part.
  2.  Created
    1. “Created” is automatically managed and updated by SharePoint.
    2. It can be added as an embedded metadata in documents, by inserting the “CreateDate” Field Quick Part.
  3. Created by
    1. “Created By” is automatically managed and updated by SharePoint.
    2. It can be added as an embedded metadata in documents, by inserting the “Author” Field Quick Part.
  4. Modified
    1. “Modified” is automatically managed and updated by SharePoint.
    2. It can be added as an embedded metadata in documents, by inserting the “SaveDate” Field Quick Part.
  5. Modified by
    1. “Modified By” is automatically managed and updated by SharePoint.
    2. It can be added as an embedded metadata in documents, by inserting the “LastSavedBy” Field Quick Part.
  6. Version
    1. “Version” is the document’s version number.
    2. By default, it is not available to embed in documents, but by following the instructions below, you can embed it, by inserting the “Label” Document Property Quick Part.
  7. Title
    1. “Title” is a regular document column that users can update, if the column is available in the documents’ content type, as mandatory or optional.
    2. It can be added as an embedded metadata in documents, by inserting the “Title” Document Property Quick Part.
    3. This column is synchronized with the documents’ “Title” property.

How to make “Version” available as an embedded metadata

The “Version” column can be made available as embedded metadata but it requires a few manual steps and these need to be done per workspace where you want to create documents. A prerequisite is that you login to the workspace with a user account that has administrative permissions, preferably with an account that is a site collection administrator in the workspace. The instructions are:

  1. Open the workspace’s SharePoint site.
  2. Open the document library’s settings by clicking on “Site contents” on the left navigation, then clicking on the ellipsis (three vertical dots) and selecting the “Settings” option:
    Open the document library's settings
  3. Under the “General Settings” section, click on the “Information management policy settings” link:
    Link to "Information management policy settings"
  4. Click on the content type that you want to enable labels on (if you have several content types in a workspace, you need to do the following steps on every content type).
    1. Check the “Enable Labels” checkbox, but don’t check either of the other two check-boxes in that section and type “{Version}” into the “Label format” box:
      Check the "Enable Labels" checkbox
    2. Click OK.
  5. The version is now available to embed in documents, by inserting the “Label” Document Property Quick Part.
  6. The version label “{_UIVersionString}” will show up in the document.
  7. Save the document.
  8. If you want to test it, close the document and reopen it. The updated version will automatically appear where you inserted the version label.

Other Document Property Quick Parts that can be used as embedded metadata

Apart from the file properties mentioned above, other file properties can also be added as Document Property Quick Parts. Some of these can be set, from Microsoft Word, by clicking on the document’s “File” tab, selecting “Info”. The properties are located under the “Properties” section:
Other file properties that can be added as Quick Parts

These properties plus a few more, can also be set and updated from within Word, by first adding them as Document Property Quick Parts and then updating their values:

Quick Part’s name Available as File property?
Abstract
Author Yes
Category Yes, as “Categories”
Comments Yes
Company Yes
Company address
Company E-mail
Company Fax
Company Phone
Keywords Yes, as “Tags”
Manager Yes
Publish Date
Status
Status Yes
Subject Yes