Adding a merge field to an email hyperlink in an email mailmerge

I am using word 2010, excel 2010, and outlook 2010 to send out the following email with email mailmerge to 50 + people.

The highlighted names in the greeting are two merge fields - First_Name and Last_Name.

The hyperlink is an email hyperlink to the following email message:

Will you attend?   ___ Yes   ___  No

The hyperlink is as follows:

I would like to place the merge First_Name Last_Name in the hyperlink to sign the RSVP email back to me. I have tried many modifications of the hyperlink code and nothing works consistently. It will place one name as the signer but will not pick up the following names the merge fields.

I would like the final email hyperlink to look like this:

Will you attend?   ___ Yes   ___  No

Jody Smith

Can anyone tell me how to add the First_Name Last_Name to the hyperlink email so that each ricipient's name from the original email will appear in the hyperlink email as shown above?

Thanks!

Ben

Answer
Answer

(Edited a little...)
I can get this to work here, but there are some things you need to pay attention to when merging to HTML email (rather than to new documents etc.).

The Hyperlink field code I start with is as follows:

{ HYPERLINK }

Insert that using ctrl-F9 to insert the special field brace pair { }, insert the Word HYPERLINK, then select the field and update it using F9.


View the field code results (press Alt-F9 if necessary). In the English language version of Word you should see 

Error! Hyperlink reference not valid.

Important point number 1: Do not update the result of this HYPERLINK field again (i.e. don't select it and press F9). If you do, every email will always show the same link text. As far as I can remember, this behaviour is different when you merge to a document rather than email, or perhaps merge to attachments. This can be a problem if you need to update other fields in your email, or if the email is being used by other people who might (for whatever reason) update the HYPERLINK field

Now modify the display text.

Use the Arrow keys to move the insertion point so it is between the "E" and the "r" in the Word "Error", and type

Click here to RSVP!

Then you can select and delete the "E", and the "rror! Hyperlink reference not valid."

Select the text and apply the Hyperlink style to it (Home tab of the Ribbon->Styles).

When you toggle field code display using alt-F9, you should see the original field

{ HYPERLINK }

Now click after the K of HYPERLINK and insert the following fields and text (or copy them from somewhere else):

 "{ SET x 1 }mailto:*** Email address is removed for privacy ***?subject=July%20Wine%20and%20Spine%20&body=%20Will%20you%20attend?%20%20%20___%20Yes%20%20%20___%20No%0A%20%0a%2{ MERGEFIELD First_Name%20{MERGEFIELD Last_Name }"

so that your field now looks like

{ HYPERLINK "{ SET x 1 }mailto:*** Email address is removed for privacy ***?subject=July%20Wine%20and%20Spine%20&body=%20Will%20you%20attend?%20%20%20___%20Yes%20%20%20___%20No%0A%20%0a%2{ MERGEFIELD First_Name%20{MERGEFIELD Last_Name }" }

As usual, all the {} need to be the special field code brace pairs that you can enter using ctrl-F9 on WIndows Word.

At this point, experienced field users will have to resist the temptation to select the fields and update them. Dont do it!

Save the document.

Test the email merge. At this point, I would hope to see the results you want.

If not, I do not know why this works OK on my system but not yours.


Important point number 2 You may be wondering why there is a { SET x 1 } field inside the HYPERLINK code. It's because when you are working with a .docx, if you save, close and reopen your document, you may find that Word has resolved all the merge fields nested inside your HYPERLINK field (i.e. replaced the field codes by their results). This behaviour can appear arbitrary, and the reason that (for some reason), Word does not resolve the nested fields if there is a Word bookmark inside the HYPERLINK field. Now if the insertion point or selection ws inside the HYPERLINK field when you save/close the document, there will be a bookmark in there, because Word inserts a bookmark called _GoBack, which enables the user to go back to the previous selection. But if you click outside the HYPERLINK field before you save, there wil be no such bookmark and Word will resolve your field codes. So we put the { SET x 1 } in there to ensure that there is a bookmark (in this case, called X) to prevent that from happening.

Alternatively, if you save as .doc format (not recommended these days if you can avoid it) Word does not resolve these fields and you don't need the { SET } field.

And that's it. Whether that will be enough for your Merge to work as you hope, I cannot be sure, but all I can say is that without doing those 2 things, it almost certainly won't.

[[I originally had a third thing. I actually now think it's incorrect, but I'm going to leave it here just in case.

Important point number 3: If it does not work, there is at least one other thing that could be wrong, although I think it is highly unlikely. There is a Windows registry setting called FieldCalcSecurityLevel, which was introduced about 12 years ago when Microsoft made some security-related changes to the behaviour of certain types of field. I'm not going to step through how to look for that, but for example, in my registry, for Word 2010, it is at

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Word\Options


It may be elsewhere.

If you cannot find that Option, or it is there and is set to the default value (1), then something else is wrong and I do not know what it is. However, if it is set to 0 (which makes Word use its original behaviour, you will have to set it to 1 to get this to work.

]]

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated November 15, 2023 Views 4,577 Applies to: