Mail Merge in Microsoft Word with Personalised Hyperlinks

42
8354

Updated October 2017

Following a number of enquiries and comments on this particular topic, we’ve refreshed and updated this article with information relevant to recent versions of Microsoft Office.

I recently had a piece of work to do for a client that appeared on the surface to be a simple task. Just mail merging a document using a standard excel spreadsheet. What I thought would be a quick job turned into something much longer when I discovered there were hyperlinks in the spreadsheet that needed including in the merged document.

Now, this is itself isn’t a problem, if all we wanted to do is display the full hyperlink in the final document. In this case, the merge would work, but the link itself would be transformed to plain text rather than a clickable link – annoying, but not the end of the world. This problem was one step more complicated than that! I wanted to display the same ‘link text’ (e.g. the words ‘click here’) on every merged document, but have a different link address (URL) for each document. There was a good reason for this, the letters were going out to individuals, directing them to their own personal page on a website, so we needed this level of personalisation and because the links were so long and ugly, the option to just display the the full link address on each page wasn’t possible.

In addition, we wanted to merge in the email address of their account manager, and make it clickable so that they can email their advisor with any problems.

There’s a great little workaround for creating dynamic links in a mail merge by adding a hyperlink field around the mail merge field; and here’s how to do it.

Step 1: Setup your mail merge

Firstly, set up your mail merge document as usual, adding merge fields the way that you would normally (Reminder: Mailings > Start Mail Merge > Select Recipients > Add merge field)

Now here is the important bit. If you want the full email address or URL as shown in your source data to show up in your merged document, then simply insert the mergefield in the usual way. However, if you want to place a link behind some standard text (i.e. “click here” as in this example) make sure that the link text that you want already appears in the body of your letter.

In the example below we are using the words ‘click here’. You can also see a sample of our Excel data, with the name of the recipient and their personalised web link.

Step 2: Create your hyperlink fields

When you are ready to insert your hyperlink fields, highlight the text that you want to use as your link text (in this case ‘click here’) and key CTRL+K to apply a hyperlink using the first URL from your list of data (Note: this can actually be any URL you choose, real or made up).

Do the same for your email field by highlighting the “email” merge field in your body text, press CTRL+K to open the hyperlink wizard then make sure you choose link type “email address” before typing any email address in the email address field.

What you’ll then see is that your email address field has changed to a clickable link email address.

Step 3: Create your dynamic links

Now comes the wizardry we need to create your dynamic links.

Press ALT+F9 to toggle your field codes, and you will see your link now displayed like this: { HYPERLINK “http://yourlinkhere.com” }

Merge_Hyperlinks3

 

You now need to change this code so that your merge field for the URL replaces the URL displaying currently. Do this by placing your cursor after the word ‘HYPERLINK’. Delete everything between the inverted commas and place your cursor there.

Now insert your merge field in the usual way by clicking Mailings tab > insert merge field > your merge field So for example if your merge field is “Page URL”, you need to put your cursor between the inverted commas after the word HYPERLINK and insert  the mergefield “Page URL”. The code will change to look like this:

{ HYPERLINK “{ MERGEFIELD PageURL }”}

Your finished document will look something like this…

Once you have inserted your merge fields and are happy with them, toggle the field codes again by pressing ALT + F9

You should notice that your links have merged to match the first row of data in your database. If you preview the document and hover over your links at this stage, it may look like the merge has worked, but worry not, this is ok. We will update the fields in the next step.

Step 4: Finish your merge

You can now proceed to finish your mail merge in the usual way.

Select Finish & Merge > Edit individual documents. The resulting document will have individual hyperlink fields and if you should see that the URL for each is personalised.

Merge_Hyperlinks5

 

There’s now one final step you have to do which is important.  You need to update all hyperlinks in the document. Do this by pressing CTRL+A to highlight the entire document, followed by F9.

Your hyperlinks should now be updated and your document is ready to be printed. You can check your hyperlinks by clicking on them or hovering over them to display the link address.

Merge_Hyperlinks6

42 COMMENTS

    • Hi Lynn, this article is looking at mail merging in Microsoft Word, I think the process is slightly different if merging into an email. Which email client are you using? Perhaps I can make that a subject for a future article.

      • Is there any update for e-mail merging fails as first merged data in every each hyperlink adsress . I am using outlook2007 client

  1. Thanks for the very helpful post. I’m trying to set up a template email that incorporates individualized links like the article demonstrates. However, when I save my document with the mergefields and open it later, the hyperlinked mergefields are all set to the first URL I have in my spreadsheet/data source. It seems I would have to redo the hyperlinked mergefield trick you explain every time I wanted to use my template.

    Is there a way around this?

    • Hi Michael – did you ever find a way round the link reverting when you save it? I’m having the same problem and can’t find a solutions.

      Thanks

  2. The CtrlA and F9 is a step missing on other directions thanks. I am able to get clickable links but they are the same for all records.

    Using Word Excel and Outlook 2007. All other data in the merge changes for each record. Just the link stays at the first value.

    Thanks for any help.

  3. I’m creating bios for a couple hundred people and one of the fields is their email. I want the email to be a hyperlink in the word bio (I don’t want to “click here”). The email is a hyperlink in the excel document but when I merge it isn’t a hyperlink. How do I do this?

    • Hi Smita, did you follow the steps right to the end? Including press “Finish & Merge” then highlight all and update values by pressing CRTL+A+F9? That’s the secret to making this formula work. I’ve just refreshed to article to make those steps clearer.

  4. Same as smita I’m still struggling with this. Can create the hyperlink but each email returns the value of the first URL in my spreadsheet. Any ideas on how to make it dynamic? Any help would be greatly appreciated!

  5. Thanks for this article – very helpful. 🙂 However, I echo what other commenters have said – it doesn’t work if merging to email. One simply ends up with a very long Word document whose pages, although each contains different, personalised dynamic links, cannot then be emailed out to individual recipients, as it’s now just one long document. :/

    • Hi James,

      Sorry to hear you are struggling, I know a few people have had the same issue. Can you tell me what version of Microsoft Office you are using? I plan to look into this and write an updated article for this topic but there are different solutions for the different versions Thanks! Steph

  6. THANK YOU! This is PERFECT! Note: you cannot “shortcut” the method by copy/pasting your code and editing it. You need to follow all the steps for each different URL you need. And the final CTRL-A, F9 is CRITICAL (I somehow read over that part!). THANK YOU for posting this! 🙂

  7. I am sending a mail merge email and it worked for me the first time (when testing), but it doesn’t work for me anymore. All emails contain the same link. Please help

  8. Hi Steph, Thanks for providing some info on this. I’m interested in having an email mail merge with dynamic links with the text ( click here). I have followed the steps you mentioned but can’t get it to replicate for a email mail merge. When you hit Finish and Merge, i’m assuming i would need to select “send email messages”. When would i hit F9 to update the links? This works if i were to just have a document, but i can’t get it to work for an email mail merge.All email have the same link. I’m currently using word 2016. Please advise! Thanks!

    • Michael and James, depending on the version of Word you have, this might help. I figured it out on my own, but this clarification might help for the updated versions.
      -Follow the steps above
      -Step 4, after you hit “Edit Individual Emails…” it generated a new, long word document for me (mine is called Electronic Messages1)
      -Don’t close the original Word document.
      -In the new Word document, perform the step “CTRL+A, then F9”.
      -This will update each individual link in that long email. However, what you don’t know, is that it also updates the original Word document without you knowing.
      -Return to the original Word document and “Finish & Merge” and “Send Email Messages”.
      -IT WORKS! If you’re having doubts, do a practice round. I used a practice Excel sheet with different hyperlinks that went to my team’s email and each link sent was, in fact, specified for each of us.

      • All of it works EXCEPT when I went back to the original Word document, “Finish & Merge” and “Send Email Messages”, all of the links were the first one, even though in the long email they were all changed to be specific links. The original Word document wasn’t updated. I did a test round sending them all to myself (with different names & links, etc), and the link was the same in all of the emails. I am using Word 2016 (& Excel 2016) as far as I know.

  9. This is exactly what I was looking for, BUT, I am using the “send Email messages…” option instead and tested it with a few collegues: Word does not update (F9) between sending each email, therefore everone receives the same link ;-(
    Any idea how to force an update between sending such emails using Mail merge in Word?

  10. This article is extremely helpful. Just to push it one step further, is it possible for the “click here” text to show the image that the URL links to?
    It’s a PayPoint barcode on the end of the URL

  11. While the solution on this page works with merging to a printable series of letters (thanks Steph), it does not work with a mail merge to email. Suggestions to merge to the email without saving the source document first, also don’t work. The critical difference is whether you are merging to print, or merging to email. So, I declare this to be a genuine bug or deficiency in MS Word. However, it occurs to me that one might be able to write a macro to do the job. A topic for another day.

  12. Using MS Word 2002 (ancient, but it still works!!) under XP SP3.
    Working in the draft/editable stage, Step 4 does not offer an option “Finish & Merge > Edit individual documents” in Word 2002 but the “View merged data” button shows the (presumably the same) result with the first DB entry included. However, this does NOT show the result from your 1st Step 4 image (with the HYPERLINK etc.) but, instead, continues to show the “clickable” text with the tool-tip offer for the FIRST entry URL. Continuing by applying CTRL+A followed by F9 to the “View merged data” display for the first DB entry, appears to make NO change and, viewing the second DB entry shows the tool-tip offer for the FIRST entry URL.
    If we “Merge to Email”, the preview of the email again shows, under the “clickable” text, the SAME URL for all the emails – and NOT the individual URLs required.
    How do we get the individual URLs to be included in the individual emails??

  13. Like many others I spent ages on this. I got it to work by adding the quotes to the url field in the spreadsheet and removing them from the Hyperlink ie: { HYPERLINK { MERGEFIELD PageURL }}.
    I did not use F9 to update the document (if you do the hyperlinks will all be the same). Pressing preview and mousing over the hyperlinks, you’ll see they are all different. The file://blah/blah url is shown prefixed to the the spreadsheets URL, however when you run the merge that somehow gets ignored and the url is correctly added to the hyperlink in the emails. I tested this to a couple of my own email addresses before doing it en masse.

  14. When the final step in the process is “Merge to Email / As Attachment”, there is no opportunity to do the Ctrl A and F9 “trick”. BTW, I am translating my Word options from Dutch. I actually need to have hyperlinks in IF…THEN… ELSE formula’s and I cannot get that to work. It would be great if somebody could help me with that (Access, Word and Outlook 2016). What would be totally perfect, is if 1) I had the option of having some text in the email so recipients don’t recieve empty emails with brief instruction and Identification of my organisation in the Subject line, and 2) the attachement could be a PDF file, rather than a Word file.

  15. I am trying to mailmerge to a word doc and dynamic URLs arent populating after finishing the merge. It is taking the first record in the sheet or the cell number that we ask for and populating the same to all other contacts too. Can you please help me?

  16. I’m sending out mail merged emails and I have one particular problem. Instead of sending out multiple emails to one destination ( all with the same info but with different topics), how am I able to put all the topics on one email with out have to type out the information.

  17. This is enormously helpful. Like a lot of people, I wanted to create email messages with a changing link depending on the recipient. I didn’t need individual letters for printing. But following the above and reading the comments helped me figure it out. What worked for me: In my Excel file, I had a column with the hyperlinks I wanted inserted depending on the recipient. Within Excel, I “removed hyperlinks” from this column. The columns had the text of the links, but did not have the coding to make them link. I was then able to follow the directions above, except I did not create a new document or have to update all the links. I just sent the merge out as emails. It worked and each recipient had his/her correct hyperlink!

LEAVE A REPLY

Please enter your comment!
Please enter your name here