Tip #691: Extract an existing Word Template from CRM 2016

Tooth ExtractionIn CRM 2016 we have the fantastic Word Templates feature with which users can generate finished documents in just a few clicks. Far easier than the old mail merge options, and no need to have locally installed versions of Word, the Outlook client and so on.

But one annoying limitation of the feature for many is that there is no obvious way to download or export an existing template. So you can’t get the OOB Account Summary report, make a few minor changes and upload it – you have to start from scratch every time. Or if your colleague built a template and uploaded it to UAT then goes on vacation without sharing the original to your shared source area, you can’t upload that to production when the client signs it off.

Sarah “definitely a cat in a previous life (or the next)” Critchley is a regular contributor to CRMUG in the UK, and draws some great infographics to explain various CRM topics, or as a way to collate her notes from other people’s presentations. She wrote an article about how to auto-generate Word templates using a Workflow and the OOB Action SetWordTemplate. Buried in the article is a little nugget of information mentioned almost in passing as a bit of a “gotcha” to avoid if you choose a template for the wrong entity.

Adam “you say gotcha, I say undocumented feature” Vero spotted this and realised the potential: you can download any existing template by creating an on-demand workflow that is (purposefully) badly written. You create a new, on-demand Workflow for any entity except the one the template is for as long as it supports Notes*. Contact would be a good example here. In the Workflow you add a step to perform a SetWordTemplate Action, set the properties and select the Word template you want to export and the current entity record such  as {Contact(Contact)}.

Activate the Workflow, go find a Contact record and run the Workflow against it. The template you selected does not “work” for this entity, so the Note that is created will have the original template attached with all the raw XML content controls you need, instead of a finished document. Simply download this attachment, delete the note, and deactivate your Workflow. Next time you need to do this, simply edit your Workflow to select a different document template, re-activate and run it again.

*you can use the entity the template is for, as long as it has at least one parent entity that supports Notes. So if you have built a Workflow for Contact and later want to use this to extract a template for the Contact entity, just select the template you want and make the target something other than the Contact, such as {Company Name(Contact)}. When you run the workflow, the template will be attached to a Note on the parent Account record (in this example).

All we have to hope now is that Microsoft don’t decide this is a bug that needs fixing in a later version…

Tweet about this on TwitterShare on Facebook1Share on Google+2

3 thoughts on “Tip #691: Extract an existing Word Template from CRM 2016

  1. Karthick says:

    Much needed workaround. Thanks for sharing. I will try this out.

  2. Jason Traxton says:

    Worked perfectly to fix another one of Microsoft’s short-sighted issues.

  3. Ronald Lemmen says:

    Note: The Document Template Manager in XrmToolBox can be used as well to export templates. http://www.xrmtoolbox.com/Plugins.html

Leave a Reply

Your email address will not be published. Required fields are marked *