Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
463 views
in Technique[技术] by (71.8m points)

mailmerge - Add Variable Hyperlink in Mail Merge in Word 2013

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 }


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...