I am trying to create a mail merge with a hyperlink inside of an “if” statement (the link only appears if a certain mergefield exists), where both the link address and display text are different mergefields. I am using Microsoft Word, Version 16.101.3.
I have gotten the mergefield links to work outside of the “if” statement doing the following:
Insert > Field > Hyperlink; this creates the following: { HYPERLINK \* MERGEFORMAT }
Insert a mergefield into the code: { HYPERLINK { MERGEFIELD personal_link } \* MERGEFORMAT }
The default text says “Error! Hyperlink reference not valid.” I replace this text with a mergefield { MERGEFIELD personal_text } and delete the other text
However, these steps do NOT seem to work inside of an “if” statement. I can still do steps 1 and 2 above, but then the text itself is not clickable, and if I try to add a mergefield within the display text it just disappears.
Is this a bug, or am I doing something wrong? Are there any workarounds?
If it is not possible to get personalized display text, I would be okay with just generic text as long as the link address is a mergefield. But right now I cannot get either to work! Any help would be greatly appreciated.
Thank you!