< Back to All Knowledge Articles

Creating a Word Merge Template

  Document Management, Contract Management  Last updated: September 6, 2016     

Overview

Objective

A Word Template consists of content, layout, styles, and content controls. Common template documents are NDA's, SOW's, MSA's.

A Microsoft Word Template is tied to a Form Configuration File (XML or Doc Launcher Form) which represents the data source for the Merge Template. Data entered into the form will be passed into Word Content Control, updating the new document. 

Benefits

  • Administrators can leverage merge tags in configuring content controls in the Microsoft Word template.

Primary Process Overview

  1. Build a Doc Launcher Form and define input fields. These fields will be used to merge data into the Word template or delivered to workflow.
  2. Create Word Template. 
  3. Enable Developer Mode in Microsoft Word.
  4. Add and setup Content Control for each field in Word.
  5. Load the Doc Launcher Form.
  6. Switch to the Merge Tag View.
  7. Select the Field and Copy the Tag.
  8. Paste the Tag in the Content Control.
  9. Save the document.
  10. Upload the document to SpringCM. 
  11. Create a Doc Launcher Configuration using the Form Configuration File and Word Template. 

Admin How To

Enable developer tab in Microsoft Word 

This first step ensures that you, as the template designer, can add Content Controls to the document. These content controls act as a placeholders for data or content that comes from an external source. 

Pre-requisite:

  • In order to use content controls you need to have a document saved in the Open XML Format (.docx).
  • You should use  Word 2013 or greater on Windows. Microsoft does not support Content Controls in Mac OS. 
  • You cannot use content controls in documents saved in the Word 97-2003 format (.doc).  
  1. In Microsoft Word click the File tab.
  2. Click Options at the bottom of the menu.
  3. Click Customize Ribbon in the left panel.
  4. In the Customize Ribbon tab select the Developer checkbox from under Main Tabs.

enabledevtabnew.png

Update the Word Merge Template

In this step, we connect the Doc Launcher Form and its key data fields with the Microsoft Word document.  Here we will define where the data entered in the form will be placed in Word.

Each Word Merge Template should only be used with one Doc Launcher Form. 

After enabling the Developer Mode, you can now start to work on the Word Document. 

  1. Find the Merge Document. This document should be a Word Document that is saved in a .docx format. 
  2. Open the Document in Microsoft Word
  3. Select the Developer Tab from the Toolbar.
    • Select Design Mode: Design Mode allows you to customize the Word document and in our case embed Content Controls. When this is toggled on, you can easily add new content controls or update existing controls. CreatingMergeTemplate_DesignModeToggledOn
  4. Add the Content Control
    • Place your mouse cursor where you want to add the content control, or select the text that you want the content control to replace.
    • Add a Plain Text or Rich Text Form Content Control.  Each Content Control acts as a placeholder for data entered in the Doc Launcher Form. Please only use the Plain Text or Rich Text Content Control.contentcontrolintab.png
  5. Copy the Merge Tag from the Doc Launcher Form
    • Open the Doc Launcher Form.
    • Select Merge Tags at the top of the page. 
    • Find the Merge Tag that corresponds to the Content Control. 
    • Select the Copy Tag button to the right of the Tag. Mergetags.png
  6. Set the Tag of the Content Control
    • Toggle to the Word document. 
    • Set the Title. The Title is used to understand how the Content Control is being used.
    • Paste The Merge Tag into the Tag property of the Content Control. MergeTags_SetContentControlProperties.png
    • Select Ok.
    • Once the content control has been added to  the document, you can edit the placeholder value, shown here as blue text surrounded by angle brackets. The default value will be displayed on the document if no merge tag is entered. MergeTags_AddContentControlTag.png
  7. Repeat the above steps for each  relevant Merge Tag in the Doc Launcher Form. All Doc Launcher Form Fields may not be used in the Word Merge Template. Some fields may be used in setting up the workflow.

    IMPORTANT: The value in the tag field within Microsoft Word must be the same as the value in the merge tag field in the SXFormConfig file  

  8. Save the Word document.
  9. Check in the new version of the document in SpringCM and optionally put in a comment describing the changes made to the template.
contentdefault.png

Best Practices

  • If you have an optional field in the Doc Launcher Form referred to in a content control, then you should remove the "Clip or tap here to enter text."  Do this to ensure that this text does not display in the new document.  CreatingMergeTemplate_EmptyContentControl.png If the preferences option "Content control cannot be deleted" is selected you will be unable to delete the aforementioned text.  
  • Do not use Rich Text Content Controls with SxTerm fields as you may lose your formatting. 
  • Each Content Control should have a title. When you toggle on the Design Mode, you can easily see identify each content control by its Title.
  • Be sure not to change the Field Name in the Doc Launcher Form after you have created the Word Template and set the Control Content. If you do change the Field Name, you will need to update the Content Control in Word. 
  • If the document will be used more than once do not select the "Remove content control when contents are edited" or "Contents cannot be edited" within preferences or else the content controls will not be populated with new information. 

FAQs

 Can I use Word for Mac to setup my Word Templates?

  • Unfortunately, you can not use Word for Mac to setup merge tags. Microsoft does not support Content Controls on Word for Mac. You can add the rest of the content in Word for Mac though. 

 What version of Word should I use?

  • Documents need to be saved in Word  .docx format in Word 2013 or greater.

What Content Controls should be used? 

  • SpringCM reccomends using the Plain Text and Rich Text Contnent Control. The Plain Text Content Control contains just text. It cannot contain other items or other content controls. All text will have the same formatting style (you cannot italicize just one word of a sentance from within a Plain Text content control).   The Rich Text Content Control can contains text, tables, pictures.  
  • We reccomend that you not use Picture Controls, Checkboxes, Combo Boxes, Dropdown, Date Pickers, Repeating Section, or any Legacy Content Controls. 

 

What are the properties of each Content Control? 

  • Title: The Title is used in the Designer Mode to easily identify how you are using the Content Control. 
  • Tag:  The tag property allows you to unique you to uniquely identify. The tag is used to specify  where in the external source to retrieve the data. It is generally hidden from the end user.  The tag can only be 64 characters. 
  • Show As:  This allows you to specify how the field will appear in the document. Opions include
    • Bounding Box ( a large box around the content)
    • Start/End Tag (graphical brackets around the field)
    • None (looks like regular text in the document)
  • Color: This allows you to specify the Color of the Content Control when looking at it in Design Mode and when delivered to the end user. 
  • Remove Content Control When Contents Are Edited: If this is selected, then when the user enters content into it, the control is removed and only the content is left in the document.
  • Content Control Cannot Be Deleted: If this is selected, then the user can not delete the control.
  • Content Cannot Be Edited: If this is selected, then the user will be prevented from changing the content after the initial entry. 

 

How can I show the text of a Content Control selectively?

  • You can show selectively show the text within the Content Control if conditions are met. Below will SHOW the text if the conditions validate as true. The Field_Name highlighted below can be found when looking at the merge tag.  If the merge tag is + // Account_Name, then the field Name is Account_Name. 
    • ? //Field_Name[text()='Value']
  • Below will SHOW the text within your merge tag if the condition validates as true.  If you want to show text for NOT that value use:
    • ? //Field_Name[text()!='Value']
  • If you want to show the text within your mere if the value is blank, then use: 
    • ? boolean(//Field_Name[not(text())]) 

References