1

Is there a way to make the Hyperlink field have dynamic display text as well as dynamic URL? So far, I have the following merge tag, which is correctly pulling the URL from my CSV data source

{ HYPERLINK "{ MERGEFIELD URL}"}

I hit Alt+F9 to toggle between field source and display preview - I see I can set static text as the URL's display text, but I need to use a merge code as the display test.

The hyperlink documentation just indicates static text, I don't see a way to add a merge field. A couple of place I've seen indicate you can insert a merge tag when editing he display text, but it doesn't save correctly (on Save, it just drops the hyperlink entirely).

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
DACrosby
  • 11,116
  • 3
  • 39
  • 51

1 Answers1

0

By default, if you insert a mailmerge field into a hyperlink field, the hyperlinks will all show the first record’s address as the 'Text to display' text. Here's how you can do get a mailmerge to display your preferred default 'Text to display' text instead:

  1. Disregarding mergefield issues for the moment, insert a hyperlink into the document in the normal way, choosing whatever 'Click Here' text you want in the 'Text to display' box.
  2. Select the inserted hyperlink and press Shift-F9 to expose its field code.
  3. Replace everything in the field after 'HYPERLINK' with your mergefield.
  4. Select the field and press F9 to update the display.

In Word 2007 & later, you can make the display text variable also, by following these additional steps:

  1. Position the cursor anywhere within the display text.
  2. Insert a mergefield pointing to whatever data field you want to use for the display text (this could even be the same field as used at step 3 above).
  3. Delete all of the previous display text either side of your last-inserted mergefield (note that this field will likely have updated already).
  4. Execute the merge.
  5. After merging to a new document, use Ctrl-A, F9 to update all fields. Without this, the mergefield hover text won’t update to the correct targets.

Note 1: The above is only for merged output sent to a new document; it does not work with merges to email or print. For merges to email, see: https://support.microsoft.com/en-us/kb/912679

Note 2: Hyperlink fields modified this way are liable to cease functioning once the merge has been executed. Accordingly, it's best to save mailmerge main document before doing the merge and not re-save it afterwards. If you need to make changes to the mailmerge main document, don't make/save them after doing a merge; make/save them beforehand.

macropod
  • 12,757
  • 2
  • 9
  • 21