Wednesday, July 16, 2008

Microsoft Dynamics CRM Mail Merge Templates

Shashi Ranjan wrote on Tuesday, June 10, 2008 8:23 AM

In this blog article I would like to give you more insight into Microsoft Word document that can be uploaded into Microsoft Dynamics CRM as mail merge templates. We will talk about

  1. Different word document formats
  2. Different versions of word XML formats
  3. Controlling version of blank template used in CRM.
  4. Upload to CRM via web and outlook client.

When talking about mail merge, we need to be aware of the three types of documents.

     1. Mail merge template document (.DOT or .DOTX/ .DOTM).

- The template document is the one that is used as a basis for creating the main mail merge document.

- On the local client box, the word mail merge templates are typically located inside the folder templates folder (i.e. C:\Program Files\Microsoft Office\Templates\<language>\<type>)

     2. Mail merge main document (.DOC or .DOCX, .DOCM).

- The main document is the template used for generating the individual documents. It contains the link to the data source and the mail merge tags.

- The mail merge engine works on the main document and generate the individual documents.

     3. Mail merge generated document.

- The individual documents are the output documents generated by the mail merge engine.

- These documents can be directed as email, fax or to a single document that can be printed out.

A CRM mail merge document has to be a word XML file. Users can upload both mail merge template document and mail merge main document to CRM as CRM mail merge template files.

To upload the documents into CRM, the user might need to convert the files into their XML representation. Converting a word document into XML file can be easily done by using the “Save as” option in word.

CRM supports both versions of the Microsoft Word XML file format.

  1. 2003 Microsoft Word  called wordml
  2. 2007 Microsoft Word call the open office format. 

There are issues running document open macros on Word 2007 when template documents are used. Also files like .DOCM and .DOTM contains macros and can not be saved in 2007 word XML format. The new XML format does not allow macros. For these,  the user would need to save the documents in 2003 XML format. So the safest bet is to use and upload the main document of the mail merge in 2003 XML format to CRM.

Currently, when using blank mail merge template in a CRM web mail merge run, we also use a blank 2003 format word document as a base to start with. If you ever want to flip it to use the 2007 format, say if all your users use the new Office 2007 documents then you can do that by replacing the BlankMailMerge.XML file located in the folder “C:\Program Files\Microsoft Dynamics CRM\Server\ApplicationFiles” with another file that is in word 2007 format.

Note: the location of the CRM mail merge button on word 2007 depends on the template format version that was used.

Uploading Templates to CRM

Both outlook client and web clients can be used to upload templates to CRM. If you already have word XML file that needs to be uploaded, you can navigate to the Settings->Templates->Mail Merge template section and create a new or edit an existing mail merge template record and upload the document in the file attachment section. When templates are uploaded via web no processing of the uploaded document happens at upload time.

clip_image002

On the other hand when working inside the CRM outlook client. Users can start mail merge from the grid or the template detail page and then on the final screen of mail merge wizard, click the Upload to CRM button. When uploading the template vi2 to a Microsoft Outlook client, the users field selection, language id, associated entity etc are all automatically set to the settings they started with. Also the uploaded template file is processed to get rid of the data source and the linked query. So if the user opens the template document next time Word warnings about the Data source not found are not triggered.

clip_image004

Cheers,

Shashi Ranjan

No comments: