Skip to main content

How to create a Word merge document

Overview Adding a merge field in a Word merge document Using Standard Merge Data Source Using a User Report  Things to note   Overview Here is an example of a word merge document with the 6 merge fi

Updated over 2 weeks ago

Overview

Here is an example of a word merge document with the 6 merge fields replaced with data.

Word merge document with 6 merge fields replaced with data

For merge fields to be replaced in a merge document the following are required:

  1. Creating Merge Fields (tags) in the merge document

  2. Selecting the Data Source that will be used to populate the merge fields. This can either be using Standard Merge Data Source or a User Report

Adding a merge field in a Word merge document

Open a Word merge document and add merge fields that will be replaced with data from the merge data source. The merge data source can be either the Equus merge data sources or from user report which will be covered later. Place the cursor for the merge field to appear.

Click Insert. Then click on the Quick Parts icon and then the Field icon.

When the Field window is displayed, select <MergeField> from Field names list. Tip, press the 'M' key twice to select <MergeField>.

In the Field name field, enter the name of the data column from the data source or user report that will be returned. Do not include the “&EQ_” prefix as this will cause your merge document to be unsuccessful. After pressing

, the merge field appears in the word document. Create merge fields for the remaining fields.

Tip: Save time by creating a shortcut so that the Field..

icon appears at the top of your toolbar.

Repeating rows (where a section is defined and will repeat once for each record is returned) and Optional sections / paragraphs (where sections are defined and only appear in the document when conditions are met) can be defined in Word merge documents.

Using Standard Merge Data Source

In this example, the Merge Data Source is the<Employee Expanded> standard merge data source and is specified on the Merge Document screen. A list of standard merge data source is found here. To view the column names for a merge data source, click on the name of the data source.

Click here for a sample Word DOC file which contains six merge tags:

  • FIRST_NAME

  • START_DATE

  • SCHEDULED_END_DATE

  • RELOCATION_POLICY_NAME

  • TO_CITY

  • TO_COUNTRY

Word document with all 6 merge fields added in different places within the document

Using a User Report

The same data can be reported out using a user report.

The column caption should not contain spaces. A user report must include a filter for the relevant details to be returned.

Click here for the sample Word .DOCX file

When using a Standard Merge Source, you are restricted to using only the standard fields which may be presented in a specific format. Using a User Report as a Merge Source allows greater flexibility in returning data within the Equus Platform as well as how the data is presented by including Custom SQL fields in the User Report.

Things to Note

  • If errors arises when generating Word Merge Documents that are uploaded with .docx extension, try uploading the document with a .doc extension.

  • When only merge fields exist in a paragraph and they are all blank, that paragraph will be omitted.

Word document with 7 merge fields

In the example below, the merge fields Address Line 3, State Province and Postal Code are blank and will result in the following output.

Word document where merge fields for Address Line 1, Address Line 2, City and Country are displayed with outputs

  • To quickly identify merge tags in a Word merge document, set the Field Shading feature to "Always". To open the Word Options window, click on File at the top of the toolbar, followed by Select.

When the Word Options window is opened, click on Advanced and scroll down to the "Show document content" section where the Field shading feature is located. Select "Always" from the drop down list and press

for the changes to take effect.

Did this answer your question?