---
schema_version: "1"
id: 2c4b8d8ace5d4ca8297e6ccfc8b8dab4d496c2088fb170b1c6dcb39ae834900d
title: Guidelines for Creating Extended Mail Merge Templates
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/mailmerge_template_guidelines.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.mailmerge_template_guidelines.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a93a3158b261d20f19ef5010f74ebc273ec77b7c7a57c99001bb354f64707a75
description: Follow these guidelines when creating your mail merge templates for Extended Mail Merge.
products:
  - Sales Cloud
  - Cross Cloud
  - Service Cloud Voice
release: "264"
---
# Guidelines for Creating Extended Mail Merge Templates

Follow these guidelines when creating your mail merge templates for Extended Mail Merge.

## Microsoft Word File Guidelines

- Don’t configure mail merge templates as “protected” or “restricted access” in Microsoft Word. Refer to Word's help for information about protected Word documents.
- Don’t connect mail merge templates to external data sources such as Excel worksheets or Access databases. Refer to Word's help for information about restoring mail merge documents to what Word calls “normal Word documents.”
- Don’t save templates in .dotx file formats.

## Syntax and Formatting

Mail merge templates are created by uploading documents to Salesforce from your desktop. The syntax for these merge fields is OBJECT\_FIELD\_NAME or FIELD\_NAME. Merge fields for mail merge templates must:

- Be unique
- Contain only letters, numbers, and the underscore (\_) character
- Not exceed 40 characters

For example: AccountNumber.

## Guidelines for Using Opportunity Product Data

You can download [sample mail merge templates](https://resources.docs.salesforce.com/rel1/doc/en-us/static/misc/mm_templates.zip), which include a table of opportunity product data and modify this table as needed for your template. The Opportunity\_LineItem\_Start merge field must be inserted before all opportunity product merge fields and the Opportunity\_LineItem\_End merge field must be inserted after all opportunity product merge fields. These start and end fields trigger Salesforce to list all of the products on the opportunity.

## Insert Product Merge Fields Manually

If you also want to insert product merge fields into the table of opportunity product merge fields, you can do so manually.

1. In your Word document, place your cursor where you want to insert the merge field.
2. In Word 2003 and earlier, select **Insert** and then **Field** from the Word menu bar. In Word 2007, select the Insert tab on the Ribbon, click **Quick Parts** in the Text group, and then click **Field**.
3. Select **Mail Merge** in the Categories dropdown.
4. Select **MergeField** in the Field names box.
5. In the Field name box in the Field Properties area, enter the merge field name manually, such as Opportunity\_LineItem\_ProductName.
6. Click **OK**.