Jae
Jae

Reputation: 71

Add multiple mergefields in variable hyperlink in Word 365(version 2103)?

I am trying to figure out if it's possible to add multiple mergefields within a hyperlink. For example, when I try to use the following: {HYPERLINK "https:/wwww.myurl.com/billpay/amt={ MERGEFIELD ID * MERGEFORMAT} &PONumber={ MERGEFIELD ID * MERGEFORMAT}"} the result is: https://www.myurl.com/billpay/amt={ MERGEFIELD ID * MERGEFORMAT} &PONumber={ MERGEFIELD ID * MERGEFORMAT}.

I would like it to populate with https://www.myurl.com/billpay/amt=45.00&PONumber=1234800 .

I did refer to Add Variable Hyperlink in Mail Merge in Word 2013 but did not help in my case.

Any suggestions...?

Upvotes: 0

Views: 926

Answers (2)

Brian Bjørngaard
Brian Bjørngaard

Reputation: 41

I got my hyperlinks with mergefields working in Microsoft 365 by simply having the mergefield-values in their own lines So instead of having the hyperlink block look like this

{HYPERLINK "https:/wwww.myurl.com/billpay/amt={ MERGEFIELD ID * MERGEFORMAT} &PONumber={ MERGEFIELD ID * MERGEFORMAT}"}

I divided it into more lines like this

{HYPERLINK "https:/wwww.myurl.com/billpay/amt=

{ MERGEFIELD ID}

&PONumber=

{ MERGEFIELD ID}"}

I did some back&forth testing and it seemed to be the difference between failure and success

Upvotes: 2

macropod
macropod

Reputation: 13490

  1. Insert your two MERGEFIELDs into your document, such that you get:

«Amount»«ID»

Note: The field code representation you posted has {MERGEFIELD ID} twice, but the supposed hyperlink display refers to an amount for the first of these.

  1. Type between and either side of these so you get:

HYPERLINK "https:/wwww.myurl.com/billpay/amt=«Amount»&PONumber=«ID»"

3 Select the range and press Ctrl-F9, so you get:

{HYPERLINK "https:/wwww.myurl.com/billpay/amt=«Amount»&PONumber=«ID»"}

4 Press F9 to update the display. You should now see a hyperlink with:

https:/wwww.myurl.com/billpay/amt=«Amount»&PONumber=«ID»

5 Position the cursor anywhere within the display text and type whatever text you'd prefer to see (e.g. Payment Link), deleting any content either side of your preferred text. As per the Mailmerge Hyperlink ‘Click Here’ Insertion topic in the Mailmerge Tips and Tricks page at https://www.msofficeforums.com/mail-merge/21803-mailmerge-tips-tricks.html, you can even insert an actual mergefield into the Display text, if you desire.

Done.

Upvotes: 1

Related Questions