Dynamics CRM 4.0: Create a New Microsoft Office Word Mail Merge Document & Upload a Mail Merge Template to Dynamics CRM 4.0

Posted Tuesday, September 22nd, 2009

Mail Merge can be tricky, especially if you don’t have access to a great process flow. Lately I’ve been able to run through the Office 2007 Mail Merge functionality with Microsoft Dynamics CRM 4.0. I decided to document the process flow that I use in order help others in their journey towards creating successful Mail Merge documents and templates. Not only because I enjoy documentation (yes, I am unique…), but because I couldn’t find a good process flow out there of which I approved.

In this post, I will run through the process flow that I use to create Mail Merge documents and save them as Mail Merge templates.

1. Begin with a specified view in MSCRM (listview, AF view, Marketing List Members view, etc.). I like to start from an Advanced Find view, but that’s just my preference. This way I can narrow down the records. If I have 20,000 records to run a merge off of, it will take a long time. Export this information to Microsoft Word by clicking the MS Word Icon (circled in red below). This will utilize the records in question during the Mail Merge process.

01 - Advanced Find View

2. When the Mail Merge window opens, this is what you will see:

02 - MM for MSWord Window
Specify the following properties:

  1. Mail merge type: letter, email, etc.
  2. Template usage vs. Blank document usage: always start with a blank document unless you have a template you know you will use – in this case, we have not created a template yet.
  3. The merge recipients: based on the view, off of which records are you creating the merge document? All of them? A few of them? You need to specify.
  4. Data fields: this is where you will need to select exactly what information will be displayed on the output (see the screenshot below). The data fields are going to display information that is captured inside of CRM (Note: there is a maximum of 62 fields).

Tip: You can include data fields on different entities. If you look at the red area, I’ve highlighted the record type dropdown. This will allow you to include information from the User record, from the Account record, etc. As long as the record is directly related to or associated to the record in question, you can include data fields in the merge. When I do merges, I like to include information in the signature, so I include Owner information, like the Owner’s Salutation, Main Phone, Full Name, and Job Title.

03 - Adding Data Fields

3. Click OK when you are finished filling out the information on the main merge window. This will allow you to exit MSCRM and enter MS Word.

4. Upon entering MS Word, navigate to the Mailings tab (or Add-Ins tab, whichever is the case) and click CRM. This will enable the macros required to perform the merge.

04 - Click CRM inside of MSWord on Add-In Tab

5. Next, verify your recipients…

05 - Verify Recipients
…and then run through the steps included in the Mail Merge wizard (located on the right-hand side of your screen):

06 - Completing Initial MM Wizard Tasks

1. Add an Address Block
2. Add a Greeting Line
3. Include the body of the letter, including Data Fields (by clicking More items, you will see the window below. Click Insert to place the data fields into the document):

07 - Add Data Fields

4. Add a closing statement (Sincerely, Regards, Respectfully, etc.)
5. Insert information relating to the sender, including a signature, logo, or additional information.

Your document before previewing your letter should look like this:

08 - Before Previewing Letters

6. Click Next to preview your letters. Make any additional changes as you see fit.

7. Click Next to complete the merge. This is where you will print your letters. Click Print. Specify what you want to print, and then click OK. You will then need to specify the additional printer properties before clicking OK to print your letters.

8. Now you need to save your merge document as a template. Click the MS Word icon/gem at the top left, and click Save As. Navigate to the correct location, name your document, and then specify the type to be a Word XML Document (extremely important! Uploaing it as a template will not work unless it is in this format.). Then click Save.

12 - Save the Document as an XML File

9. To upload the document in CRM for future use as a merge template, navigate to the Settings area in Dynamics CRM. Click Templates, and then click Mail Merge Templates.

13 - Go to Mail Merge Templates

10. To upload your XML document as a template, click the New icon. Then fill out the information:

  1. Name
  2. Description (optional)
  3. Associated Entity
  4. (Everything else should be already populated)

11. Then you need to attach your XML document. Click Browse…

14 - Enter Mail Merge Information, Click Browse

…find the XML document, and then click Open.

15 - Browse for XML Document

**Note: Merely clicking Open and seeing it at the bottom does not attach it. You need to click Attach.*

12. Then you need to specify the Data fields (same situation as Step 2D). This will allow them to be used anytime you use this template.

13. Then you need to specify if you want this template to be available to the organization. If so, click Actions, and then click Make Available to Organization.

17 - Make Available to Organization

14. To finally save the template and begin to use it, click Save & Close.

15. Your template is now ready for use. To test its usability, navigate through the first 2 steps of this document. When you get to the point of the merge window where you need to select a blank document or a template (Step 2B), select the template property in question (either personal or organization – in this case, personal)…

18 - Select Personal Mail Merge Template

…then click the magnifying glass. Below is what you will see.

19 - Select the Template from Lookup View

You will be able to select the template and add it to the merge window. The correct mail merge document will then be populated in the Personal mail merge template field. When you use this template and begin the merge, you will still need to verify your recipients and click CRM, similar to the above steps in this post, but you will already see your basic outline laid out for you. Your Address Block will be there, your Greeting Line will be there, your Email Body, your Data Fields, everything. All you need to do is verify the individual documents and print. As simple as that.

Tip: Be sure that if you make any adjustments to the template, that you resave it as a Word XML Document (I would replace the existing file – it’s just easier that way) and re-upload it into the template inside of CRM (remove the existing XML, and attach the new one). That way when you go back to use the template inside of CRM, you are using the most recent template. Not the one that is outdated.

I hope this helps!

19 Responses to “Dynamics CRM 4.0: Create a New Microsoft Office Word Mail Merge Document & Upload a Mail Merge Template to Dynamics CRM 4.0”

  1. Mehmet Şirin ÇELİK says:

    with the exception of quotes/quote products, you can not reflect fields from child related entities, just parents–so if you were performing a mail merge from accounts and you have a child custom entity related to it, you could not look up fields from that entity for your mail merge.
    is there any solution ?

  2. I’m not quite sure I understand what you are asking. When I’m adding Data Fields to my mail merge job, prior to entering MS Word, I can add custom fields from those entities that are lookups on my Account form (for example, information from a Project Manager record that is situated on the Account form in a lookup field).

    If you are asking about adding data fields from a child record, say Activities (a child record to the Account), it would be illogical. To ask the system to include an individualized data field when it has more than one record in question wouldn’t make sense. Referring to my Project Manager example, from the Account form, there is one record associated to the Account in the form of a User record. The functionality has the ability to reference that form because there’s only one record.

    I do have one idea for you that you can try. If you did want to include information from the child records related to the parent, you may need to reverse the process. Select all the child records upon which you want to do a mail merge, and then select the related Account information from there (in this case, there would only be one Account record). Despite the restrictions on certain entities related to mail merge, you can do mail merge on custom entities.

    I hope this makes sense. Try it out, and let me know if it works for you.

  3. Mathieu Cloutier says:

    Hi !

    Very interesting blog! There is just one thing very sad about mail merge functionnality: it only works on a small subset of existing entities. For example, you cannot run a word mail merge on the CASE entity or in the CONTRACT entity !

  4. Yes, that’s true. The Case and the Contract refuse you the ability to do Mail Merge. However, you could try it from a different angle – do an Advanced Find based upon the certain criteria you would want (for example, all Contacts with active Cases), then do the Mail Merge from that angle. You won’t be able to include Case specific information, but you can still find the people in question with active Cases, and contact them if necessary.

    The limitations are unfortunate, but there are other possibilities as long as you think through what you’re trying to accomplish. I hope this helps!

  5. AR says:

    Actually, you can mail merge cases.
    Take a look at this website:
    http://nishantrana.wordpress.com/2009/10/08/enabling-mail-merge-template-for-other-system-entities/

    You still won’t get the ‘Mail Merge’ link in the case, but the Word icon appears in the search screen.

  6. Mayckel Gouma says:

    You can make CRM shows the MailMerge icon on every entity you want! Follow these steps;

    The most easy way to enable a mailmerge field for any entity is this;

    - Go to SQL Studio Management
    - Go to the CRM database and open Views > EntityMap > Right mouse > Open View
    - Search in the column Name the entity where you wan’t to enable MailMerge
    - Go to the last Column ‘IsMailMergeEnabled’ and set the value to true
    - On the CRM server, go to start > run > type ‘iisreset’ and press return.
    - Restart CRM and you mailmerge is enabled for the edited entity

  7. Mayckel Gouma says:

    I’m sorry it’s ‘EntityView’ instead of ‘EntityMap’

  8. Andreas Galanis says:

    Good morning,
    I’m trying to mail merge documents having acccess to CRM via IE8. When the document opens, no CRM button appears neither in Mailing tab nor in Add ins tab (This tab doesn’t exist)

    Do I have to install an add in ?
    Should I work using Outlook only ?
    Is any additional install or change I have to do in MS Word 2007 ?

  9. Andreas – make sure you’re logged into the server (either internally on the domain, or through a VPN of sorts). Then make sure you’re exporting TO Microsoft Word FROM CRM.

    If neither of those options work, try rolling back to IE7. The compatibility with IE8 may still not be there.

  10. Mehmet Şirin ÇELİK says:

    I mean that,
    how can we mail merge salesorder and depending salesorder products(salesorderdetails)?
    or invoice and invoice details ?

  11. If the relationship is a one to many, most likely the mail merge will not work. The system would not know which one of the many possibilities to reflect in the data fields.

  12. Fer says:

    But how it’s mentioned in the first question you have the exception of quotes/quote products. There is an OOB template “Quote for Customers” which does that.
    It uses Directory mail merge option of Word MailMerge functionalities. It combines Quote data and a list of Quote Products.
    Is there any suggestion to extend this for other entities using one to many relationships?

  13. Triggger says:

    Hi
    Thank you for your solution.
    I did enabled the mail merge for the invoice table and its working greate for invoices with the status ‘New’ bu when I do mail merge for invoices with the status ‘Paid’ its not returing any values in the mail merge document.

    any idea?

  14. Rahul says:

    Hi,
    I have a question. When we are creating a mail merge template we are selecting data fields there. Now I share this template for someone else to use. While using this template when a user performs the merge operation he again has to select data fields(if he has a field in the template apart from the ones selected by default). Then what is the point of creating a template if one has to select the fields again..? Is there a workaround for this case ?

  15. I’m not aware of any mods you could make to the system or the template that would fully save all data field selections. The purpose of the template is to save just that – the template. For example, you have a 4 or 5 page document that you don’t want to type out every time you send to customers. This would be a prime situation where you would use the template. The time spent checking a few boxes before running the template is drastically lower than the amount of time spent to regenerate an entire mail merge document each week, month, or even year. I’ll keep me eye out for any additional information on this and follow-up if necessary.

  16. Jeremiah Cooper says:

    Is there a way to get case notes into a mail merge template? We just switched over to microsoft CRM 2011 and we are used to printing out our cases and hand delivering them to our boss. The major problem is that the way the case is laid out from the print area in cases is not modifiable. Another option would be if someone knew how to modify the print preview under file in the cases.

  17. Jeremiah,

    Incorporating associated records into a Mail Merge is always tricky and never works properly (it “merges” all of the associated records together, removes formatting, or creates multiple pages – it’s a mess). More specifically, adding Notes to a Mail Merge isn’t possible. Furthermore, modifying the print preview isn’t an option either (if it is, the way to do it is either not supported or has not been identified). Other options for you if you all need something custom to print for your boss would be either creating a custom SSRS report that pulls Case information in a preferred format, including Notes. You could also create a custom web page that you access from the Case form. It could open in a new IE window and display what you need to display. A print option could be built from there. Each of these options would require either advanced consulting work or development work and could not be done through Mail Merge.

    Kristen

  18. Parag says:

    I have a Mail Merge Template available on my CRM. I need to a new field to the template. I have selected the field in my ‘Data Fields’ list. How do I add the field in the template? Could anyone guide me through the process of modifying an existing Mail Merge Template and upload it again on CRM…

    Thanks
    Parag

  19. Parag – there are a few different ways to do this. My preferred way is to rerun the Mail Merge on a test record. Select the additional data field in the window where you select your Mail Merge properties for creating the document. Once the Mail Merge opens, you will add the data field by clicking “Insert Merge Field” on the Mailings tab within Microsoft Word, and then selecting the field you want to add. Make sure you place the data field in the right location in the document. Resave the Word XML document after you have previewed your changes, and then re-upload the document within the template record inside of Dynamics CRM (you can remove the outdated attachment, then Browse out to the location of the newly updated Word XML document). Be sure to add the data point again inside of the template’s selected columns (which it seems like you have done). Like I said, this is my preferred way because I have the ability to test the new changes at the same time I’m updating the document. Hope this helps.

Leave a Reply

*
*