Document templates and Word mail merge in Dynamics 365

How to generate Word and Excel documents from Dataverse records — document templates, mail merge, and the customer-facing document workflow.

Updated 2026-12-12

For customer-facing documents — proposals, contracts, statements, certificates, personalised letters — Dynamics 365 generates Word and Excel files from document templates bound to record data. The mechanism replaces what used to be manual Excel exports and copy-paste, producing consistent, branded documents with one click.

Document templates. A document template is a Word or Excel file with placeholder content controls that bind to Dataverse fields. The user creates a record (an Opportunity, a Quote, an Order, a Customer), clicks Word template or Excel template, picks a template, and the system generates a personalised file with the record's data filled in.

Creating a Word template.

  1. From the record page, click Word Templates → Create Word Template.
  2. Choose the source entity (Account, Opportunity, etc.) and related entities to include (Contacts on the Account, Opportunity Products, etc.).
  3. Download the template skeleton — a .docx with the XML schema for the chosen data.
  4. Open in Microsoft Word. The XML Mapping Pane (Developer tab → XML Mapping) shows the available fields from the selected entities.
  5. Design the document layout — headings, paragraphs, tables, images, branding.
  6. Drag fields from the XML Mapping Pane to insert content controls. A {!Name} placeholder for the customer name; a {!Total Amount} for the opportunity value; a repeating section for line items.
  7. Save the template.
  8. Upload back to Dynamics 365.

The template is now available for that record type. Selecting it generates a personalised document.

Excel templates work similarly — for analytical or spreadsheet-style outputs.

System templates vs personal templates. Templates can be system-wide (available to all users with permission) or personal (visible only to the creator). System templates are governed through solution lifecycle.

Common use cases.

  • Sales quote PDF — Word template that renders a branded quote document from an Opportunity's products and prices.
  • Statement of work — long-form document with sections personalised to the customer and engagement.
  • Welcome letter — personalised onboarding letter to new customers.
  • Service report — a Word template summarising completed cases or work orders for the customer.
  • Certificates — training completion, compliance certifications, audit attestations.
  • Inspection reports — Field Service inspection results rendered as a customer-facing PDF.

Limits.

  • Single record at a time typically — Word templates target one record (and its related records), not bulk lists.
  • Limited formatting flexibility — Word's content controls don't support arbitrary advanced layouts. Heavy graphic design is awkward.
  • Performance on large repeating sections — a template iterating over 10,000 line items will be slow.
  • No e-signature integration native — generate the document, then send to DocuSign / Adobe Sign / similar.

Mail merge (legacy). Older Dynamics CRM versions had a mail merge feature explicitly for bulk personalised letters / emails from a list of records. This has been largely deprecated in favour of:

  • Customer Insights – Journeys for marketing-grade bulk personalised email.
  • Word templates with Power Automate flow for bulk PDF generation (a flow iterates records, generates a document per record, distributes).

The pattern for "generate 500 personalised letters" today: build a flow that loops the records, calls the Word template service, attaches the resulting file to each record, optionally emails.

Power Automate integration. Modern bulk-document patterns use Power Automate:

  • Trigger — a button on a view, a scheduled run, or a Dataverse event.
  • Action: Populate a Word template — supply a template and the source record data.
  • Action: Convert to PDF (optional) — for distribution.
  • Action: Send email with attachment or attach to the source record.

This pattern combines Word templates with flow logic to handle the bulk case.

Branding consistency. A useful pattern: build a small library of Word templates for the company — 5–10 templates covering the major customer-facing scenarios — branded consistently. Maintain centrally in a solution; users select from the library rather than rolling their own.

Common pitfalls.

  • Template references fields that don't exist — if the schema changes, templates break silently.
  • Repeating sections without proper grouping — generate documents missing line items or with duplicated data.
  • Heavy templates exceeding limits — very large documents may fail to generate.

Operational reality. Word templates are the unglamorous workhorse of customer document generation. Built well, they save hours per week per sales / service rep.

Related guides