Mailmerge dynamic hyperlink fields lost after save/reload of document - Word 2010
Asked Answered
T

1

2

I have a problem where using dynamic hyperlinks in field codes works fine when I create a document, but when save and later reload it the links are replaced with text from the original recordset. The field code I am using is:

{ HYPERLINK { MERGEFIELD "Fieldname" } \* MERGEFORMAT }

After saving then reloading the document this becomes similar to:

{ HYPERLINK "http://www.example.com" }

I am merging to HTML email.

I have been unable to get this to successfully work after saving. This is a simplified version of what I'm trying to do and the only part I can't get to work properly. I need to get the mail merge document prepared for someone else to run, rather than be there to set it up each time it needs to be run.

Any help on this would be much appreciated.

Thermolabile answered 29/5, 2013 at 15:0 Comment(1)
I have checked what happens with your suggestion, and the same happens, the field resolves to whatever the address is in the first record. Thanks for suggestion though.Thermolabile
P
3

In addition to inserting the { MERGEFIELD Fieldname } field, insert a uniquely named bookmark via Insert->Bookmark, say, immediately after the mergefield field.

I cannot guarantee that that will "work" in all circumstances, but so far it seems to do the trick. Another possibility if you do not want to have to remember any distinct bookmark names would be to insert a nested field like this instead:

{ SET "mfkeeper{ SEQ mfk }" " " }

If you do that, and update the nested SET field before doing anything else (such as updating the HYPERLINK field), you get a uniquely named bookmark (mfkeeper1, etc.). Whether that is sustainable, I cannot currently tell.

This behaviour gpes some way to explaining why the nested HYPERLINK behaviour seems so arbitrary - if you select the HYPERLINK fields and update them all via F9, Word inserts its _GoBack bookmark into the HYPERLINK field, and that's what seems to prevent Word from resolving the nested MERGEFIELD field.

Prater answered 4/6, 2013 at 11:9 Comment(2)
Inserting bookmarks immediately after the mergefield seems to do the trick! The Mergefield remains dynamic and doesn't resolve to an actual address on reloading the document. Thank you so much!Thermolabile
I am amazed, but adding a bookmark works. I had two dynamic URLs each with several MERGEFIELDs. Adding a bookmark after the last MERGEFIELD of each URL fixed it. (I only wish I came here earlier; I've spent hours troubleshooting this)Reckless

© 2022 - 2024 — McMap. All rights reserved.