Add Variable Hyperlink in Mail Merge in Word 2013

01jayss picture 01jayss · Jul 2, 2013 · Viewed 73.6k times · Source

I'm trying to add a hyperlink to a mail merge field. So something like this:

{HYPERLINK "{MERGEFIELD "Links" }"}

So I create a field like this.

{ MERGEFIELD Links }

And the above works (it displays different links for different recipients).

However, when I go to Edit Field, and then attempt to add HYPERLINK to { MERGEFIELD Links}, Word will not allow me. Meaning that when I type HYPERLINK followed by a space, the "variable" field is gone. Instead of word displaying...

LINK

it displays...

   {HYPERLINK "{MERGEFIELD "Links" }"}

even after I press "update field". So Word is not letting me enter HYPERLINK for some reason.

How do I solve this?

Answer

theMayer picture theMayer · Jun 10, 2016

From the Microsoft Web Site,

  1. On the Insert menu, click Field (under Quick Parts in later office versions).
  2. In the Field names list, click Hyperlink, and then click OK. The text Error! Hyperlink reference not valid appears in the document.
  3. Press ALT+F9 to open the { HYPERLINK \* MERGEFORMAT } field code.
  4. Put the insertion point after HYPERLINK and then add a space.
  5. On the Insert menu, click Field. In the Field names list, click MergeField. In the Field name text box, type the name of the data source field that contains the hyperlink, and then click OK. For example, if the name of the data source field is "Address1," the field code appears as follows: { HYPERLINK { MERGEFIELD "Address1" } \* MERGEFORMAT }
  6. Press ALT+F9 to close the field code. You now have Error! Hyperlink reference not valid text.
  7. Put the insertion point at some arbitrary place in the middle of the Error! Hyperlink reference not valid text, and insert the text you want to appear. If you would like a merge field, insert that from the "Insert Merge Field" option on the menu.
  8. Delete the remaining text of Error! ... before and after the text you want to keep.

Note: If your merge field only contains an identifier, with the URL to be provided as a static part of the merge document, this can work also. On Step 5, you will need to insert the URL text as well as the MergeField, for example: { HYPERLINK "https://www.myurl.com/EditForm.aspx?ID={ MERGEFIELD ID }" \* MERGEFORMAT }