This is a quick post based on a question in the Microsoft Dynamics CRM Community forum.
Problem Statement: Can I dynamically add a hyperlink in a mail merge? The URLs are stored in a field on the CRM record. Need that URL to be added as hyperlink on an image.
It is possible to add dynamic links coming in as merge fields to an image. To keep it simple, am adding the website field on account as a hyperlink in the merge document. You can use this feature to insert dynamic content for a campaign or something more useful.
Here’s how to do it:
- Select a few accounts and click ‘Mail Merge’
- You can use a template if you have. I’m going to create a Blank document. Choose the data fields required. Make sure you add the URL field. In my case, the website field. Click OK followed by ‘Download ‘ button on the Mail Merge dialog.
- You should have the word document similar to below. As instructed, enable the macros on the document
- Click ‘CRM’ in the Add-ins tab.
- You will see the records we had selected in Step 1. Click OK.
- Say that you want to distribute the high net worth accounts’ details to your key sales team. Add any text you want in the document and insert a picture (image). Right click the image to add a hyperlink.
- In Insert Hyperlink dialog, enter some temporary text say ‘TempURL’ for the Address. Click OK.
- Now press “ALT+F9” to see the code in the mail merge document.
- Delete the temporary text ‘TempURL’ in the hyperlink and use the ‘Insert Merge Field’ option to add the actual URL field.
- Press ‘ALT+F9’ to close the code. Now, select ‘Edit Individual documents’ in ‘Finish & Merge’.
- As seen in the tooltip, the URL is still showing the temporary text we had entered. Unfortunately, Word isn’t refreshing the image link automatically. Press “Ctrl+A” to select all the contents of the document and then Press F9 to refresh.
- Here is the result with all the dynamic address applied to the images!