Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
After you create and import Office Word templates into customer engagement apps (Dynamics 365 Sales, Dynamics 365 Customer Service, Dynamics 365 Field Service, Dynamics 365 Marketing, and Dynamics 365 Project Service Automation), users select one button to generate standardized documents automatically populated with data. This feature has some special considerations you need to know to successfully create Word templates.
Warning
There's a known issue when creating templates in Word. To prevent interactions that could potentially destabilize Word, review and follow the guidance in the Avoid a known issue when creating templates section of this article.
Supported versions of Word
| Area | Word Version |
|---|---|
| Creating a Word template | 2013, 2016 |
| Using a Word document generated in customer engagement apps | 2010, 2013, 2016 |
Note
Macro-enabled Word documents (.docm) aren't supported.
Follow the steps in this article to successfully create and use Word templates in customer engagement apps.
Step 1: Create a Word template
You can create a Word template from the Power Platform admin center or from a record in customer engagement apps. Creating a template from the admin center makes it available to all users in your organization, while creating a template from a record creates a personal template that's only available to you.
Create a Word template from Power Platform admin center
Access requires sufficient permissions, such as the System Administrator or System Customizer role. To check your security role, see View your user profile. If you don't have the correct permissions, contact your system administrator.
- Sign in to the Power Platform admin center.
- In the navigation pane, select Manage.
- In the Manage pane, select Environments.
- On the Environments page, select an environment and then select Settings in the command bar.
- Expand Templates, and then select Document templates.
- In the Available Templates View page, go to the command bar and select New > Download Word Template.
- In the Download file to create a template dialog, select the entity for which you want to create the template.
- Specify the entity relationships that you want to use in the template. For example, if you select the Account entity, you can specify a 1:N relationship to the Contact entity to include contact information in the template. Learn more about relationships in What are 1:N, N:1, and N:N relationships?
Note
- The relationships you select on this screen determine what entities and fields are available later when you define the Word template.
- Select only the relationships you need to add data to the Word template.
- Select Download to download a Word file on your local computer with the exported entity included as XML data.
Important
You can only use a document template in the environment where you downloaded it. Environment-to-environment migration for Word or Excel templates isn't supported.
Create a personal Word template from a record
As a Dynamics 365 user, you can create a personal Word template that you can use for your own sales documents. These templates are only available to you. The following steps are for Dynamics 365 Sales, but the process is similar in other customer engagement apps.
- Sign in to the Sales Hub app.
- Select the entity for which you want to create the template. For example, if you want to create a template for customer accounts, select Accounts.
- Open any record. On the command bar, select Word Templates > Download Template.
The entity is selected by default based on the record you opened.
- Specify the entity relationships that you want to use in the template. For example, if you select the Account entity, you can specify 1:N relationship to the Contact entity to include contact information in the template. Learn more about relationships in What are 1:N, N:1, and N:N relationships?
Note
- The relationships you select on this screen determine what entities and fields are available later when you define the Word template.
- Select only the relationships you need to add data to the Word template.
- Select Download to download a Word file on your local computer with the exported entity included as XML data.
Important
You can only use a document template in the environment where you downloaded it. Environment-to-environment migration for Word or Excel templates isn't supported.
What are 1:N, N:1, and N:N relationships?
This screen requires an understanding of your customer engagement apps data structure. Your admin or customizer can provide information about entity relationships. For admin content, see: Entity relationships overview.
Here are some example relationships for the Account entity.
| Relationship | Description |
|---|---|
![]() |
An account can have multiple contacts. |
![]() |
A lead, account, or contact can have multiple accounts. |
![]() |
An account can have multiple marketing lists. A marketing list can have multiple accounts. |
Note
To ensure documents download quickly, only return up to 100 related records for each relationship. For example, if you export a template for an account, and want to include a list of its contacts, the document returns at most 100 of the account's contacts.
Step 2: Enable the Developer tab
Open the Word template file. At this point, the document appears to be blank.

To see and add customer engagement apps XML data, you need to enable the Word Developer tab.
Go to File > Options > Customize Ribbon, and then enable Developer.

Select OK.
Developer now appears in the Word ribbon.

Avoid a known issue when creating templates
There's a known issue with customer engagement apps' apps-generated Word templates and Office Word. Follow the guidance in this section to prevent issues with control fields before going to step three where you add XML content control fields to the Word template.
Warning
A few things can cause Word to freeze, requiring you to use Task Manager to stop Word:
- You insert a content control other than Picture or Plain Text.
- You make a textual change, such as changing the capitalization or adding text, to a content control. These changes can occur through AutoCorrect as well as user edits. By default, Microsoft Word AutoCorrect capitalizes sentences. When you add a content control field, Word sees it as a new sentence and capitalizes it when focus shifts away from the field.
Only add fields as Plain Text or Picture
You use the XML Mapping Pane to add entity fields to your Word template. Be sure to only add fields as Plain Text or Picture.

Do not make any textual changes to the added content control
You can format the content control fields, such as making them bold or changing the font color. However, don't make any textual changes to the content control fields, including capitalization changes.

If you experience Word freezing or performance degradation, try turning off AutoCorrect.
Turn off AutoCorrect
With the template file open in Word, go to File > Options > Proofing > AutoCorrect Options.

Clear Capitalize first letter of sentences and Automatically use suggestions from the spelling checker.

Clear Hyphens (--) with dash (-) on the AutoFormat and AutoFormat as You Type tabs.
Select OK.
Step 3: Define the template
Use the XML Mapping Pane to define the Word template with entity fields.
In your Word template, select Developer > XML Mapping Pane to select the default XML schema.


Select the XML schema. It starts with "urn:microsoft-crm/document-template/".

Important
If you have frequent accidental edits that cause Word to freeze or have performance degradation, be sure to turn off the AutoCorrect options according to the section, Avoid a known issue when creating templates.
Expand the entity, right-click the entity field, and then select Insert Content Control > Plain Text.

The entity field is added to the Word template.

Add additional entity fields, add descriptive labels and text, and format the document.
A completed template might look like this:

Some content control fields you entered likely have multiple lines of data. For example, accounts have more than one contact. To include all the data in your Word template, set the content control field to repeat.
Set content control fields to repeat
Put fields with repeating data in a table row.
Select the entire table row in the template.

In the XML Mapping Pane, right-click the relationship containing the content control fields, and then select Repeating.

When you use the Word template in customer engagement apps to create a document, the table populates with multiple rows of data.
When the template has the fields and formatting you want, save it and upload it into customer engagement apps.
Step 4: Upload the Word template back into customer engagement apps
When you have your Word template built the way you want, save it so you can upload it into customer engagement apps.
Access to the newly created Word template depends on how you uploaded it and the access granted to the security role. Be sure to check out Use Security Roles to control access to templates.
Administrators can use the Settings page to upload the Word template into customer engagement apps. All users in your organization can use a template uploaded in Settings.
Upload the Word template from Power Platform admin center
Sign in to the Power Platform admin center.
In the navigation pane, select Manage.
In the Manage pane, select Environments.
On the Environments page, select an environment and then select Settings in the command bar.
Select Templates > Document Templates.
On the Available Templates View page, select Upload Template > Upload Word Template in the command bar.
Browse to the template file that you want to upload.

Select Upload.
Non-admin users can upload a template for their own use from a list of records.
Upload the personal Word template from a record
Open a record for the entity type that matches the template you created. For example, open a customer account record in Sales if you created an account template.
On the command bar, select Word Templates > Upload Template.
Browse to the file and select Upload.
Step 5: Generate a document from the Word template
To use the Word template you created, complete the following steps.
Open a record that matches the entity type of the template you created. For example, open a customer account record in Sales if you created an account template.
On the command bar, select Word Templates, and then under Word Templates select the template you created.
If you don't see the template you created, two possibilities exist:
You selected a record type (entity) that doesn't match the template. The system only displays templates built for the selected record type. For example, if you open an opportunity record, you won't see a template you created with the Account entity.
You need to refresh customer engagement apps to see the template. Either refresh your browser or close and reopen customer engagement apps.
The system generates a Word document with data from the record you opened and downloads it to your computer. Open the document to see the data and template in action.
Try out the sample Word templates
Customer engagement apps include five sample Word templates.

The sample Word templates are designed for a specific record type (entity). You can only apply the template to records of the same record type.
| Name | Entity |
|---|---|
| Opportunity Summary | Opportunity (Sales area) |
| Campaign Summary | Campaign (Marketing area) |
| Case Summary | Case (Service area) |
| Invoice | Invoice (Sales area) |
| Account Summary | Client_Account (Sales, Service, and Marketing areas) |
To apply a sample Word template
Open a record with information that uses the entity type that matches the sample template. For example, open a customer account record in Sales to apply the Account Summary template.
On the command bar, select Word Templates, and then under Word Templates select the sample template.
The system generates a Word document with data from the record you opened and downloads it to your computer. Open the document to see the data and template in action.
Note
The sample templates are meant to be a starting point for you to create your own templates. You can't edit them.
Additional considerations
Use security roles to control access to templates
Administrators can control access to Word templates with some granularity. For example, you can give salespeople Read but not Write access to a Word template.
Select Settings > Security > Security Roles.
Select a role, and then select the Business Management tab.
Select Document Template to set access for templates available to the entire organization. Select Personal Document Template for templates shared to individual users.
Select the circles to adjust the level of access.

Lists in created documents aren't in the same order as records
Lists of records created from a custom template might not appear in the same order in Word documents as the order in customer engagement apps. The app lists records in the order of the date and time they were created.
Issue with right-to-left languages
Content in right-to-left (RTL) languages might have some formatting problems in the Word file after the document is created.


