26. February 2013 17:52

How to use the [Insert as HTML]-button in Open Office XML templates (.docx)?

Filed Under(CRM 2011 | DocumentsCorePack 2011 | CRM 2013 | DocumentsCorePack 2013) By ssteinklauber


 This feature enables you to easily insert contents (pictures, texts, etc.) into documents which have been added to a CRM record via HTML editor. The functionality interprets HTML codes stored in CRM and to display the contents appropriately in merged documents. Furthermore, the last version of DocumentsCorePack enables users to insert pictures into documents (for more details about this functionality, please click here).

Addon: DocumentsCorePack 



Figure 1: The content in the red ellipse is the content added to the record via HTML editor in CRM.

Click here to read more about the functionalities of the [Insert]-button.


Please note: Before you can use this functionality, you must install a HTML editor into your CRM system.

There are various free, but also some charged HTML editors which you can use.

In our example, we work with the tinyMCE HTML editor. Please follow the link to get detailed information on how to implement this free HTML editor into MS Dynamics CRM 2011.


How to insert content origined from HTML editor from CRM into your document. Step-by-step description:  

1. Open e.g an account in CRM and click on HTML_Description. After that, a HTML editor will open.

test store general
Figure 1: Opened account in CRM

2. By using this HTML editor (1), you can add (3) and format (2) the information you need. Click on the [Save]-button in the CRM ribbon (4) after you have finished adding and formating your content.

insert info with html editor
Figure 2: Add and format content for CRM record using the HTML editor

3. Afterwards, open MS Word and navigate to the www.mscrm-addons.com-tab (1) in the menu. Here you can start to create your template. To do so, click on the [Insert MailMerge Fields]-button and insert some mailmerge fields. 

create template
Figure 3: Create a template in MS Word by inserting some mailmerge fields

4. If you would like to insert the content which you have added to the account before using the HTML editor, set the cursor to the position in the document where you want the information to be inserted. Then navigate to the Normal-tab in the DocumentsCorePack TaskPane on the right and select the field HTML_description (1) from the tree menu. Select the Insert as HTML-option from the [Insert]-button options at the bottom to add the field correctly (2).

insert html description
Figure 4: Insert HTML_description-field into the template

5. After that, the mergefield new_html_description is added to the template (1). Continue to create your template by inserting the mailmerge fields and the text you need. When you have finished to create your template, save it with a click on the [Save Template]-button (2) in the menu.

finished template
Figure 5: Create a template, HTML_description-field added


6. After saving the template, you can mailmerge the document with data from CRM. To do so, you have the following two options:

6.a. Start from within MS Word

6.b. Start from within CRM


Option 6a: start a mailmerge process from within MS Word

To start a mailmerge process from within MS Word, open a template with a click on the [Open Template]-button (1) in the menu. After the template has opened, click on the [Choose CRM Data]-button in the menu (2). 

 choose crm data
Figure 6: Open template and select CRM data to generate a document

A lookup-window will open. Within this window, search for/select (1 and 2) the account which data you want to add.

choose crm data II
Figure 7: Search for CRM records for the mailmerge process

Select a CRM record from the search result (1) and click on the [Select]-button (2) to trigger the mailmerge process. After the mailmerge process, the merged and completed document will open in MS Word. 

select data and merge
Figure 8: Select CRM record and trigger mailmerge process


Option 6b: start a mailmerge process from within CRM

To start a mailmerge process from within CRM, open the CRM record which data you would like to insert. In our example, we open the account Test Store.

Click on the [Generate Document]-button (1). Please note: this button was previously known as [Print in Word]-button or may be known under another name as it is configurable by the administrator in the server-settings of DocumentsCorePack.
Now select the appropriate template from the drop-down-menu (2). For our example we use the template we have created previously. After that, the merged document will open in MS Word in the background. To view and process the document, click on the [Word]-button in the taskbar.

print in word
Figure 9: Trigger mailmerge process from within CRM using the [Generate Document]-button

After the mailmerge process, the document including the data from the CRM record and also the content added to the account via the HTML editor is available for further processing. As outlined in Figure 10, the style of the text parts corresponds with the style sheets of MS Word. In our example, we select the style Heading 2 for the text Test Store and the style Paragraph for the text Test Street 123 / 1234 Test City / … using the HTML editor. In the merged document, the text parts are displayed corresponding to the settings of the style sheets of MS Word.

merged document 
Figure 10: Merged document

That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.


Tag Cloud

This will be shown to users with no Flash or Javascript.

Page List