Variable hyperlinks chosen from a mail merge data file are complicated to create especially if the hyperlink display text is also variable, or a the hyperlink is attached to merged graphics. This Word add-in aims to overcome that.
The add-in will not insert hyperlink fields in text boxes or in the header/footer ranges of the merge document. This is quite simply because hyperlinks in such locations do not work in Document format as the ranges themselves must first be selected to make the link accessible.
The add-in puts a pair of buttons on the Mailings Tab of the Ribbon:
The first button runs the process, the second operates a drop-down menu with three commands.
When activated the process determines that the document is a merge document and that a data source is attached. This is essential as the function will use that data source to apply the field structure to the document.
The dialog is self explanatory. Clicking the first check box alters the dialog to provide options for using a graphic as a hyperlink:
Using the above data source as an example (a Word table) the four pictures refer to four rectangular coloured blocks, however in a real world situation you can use any practical graphics:
Depending on the options chosen you would see either the link, the display text or the image inserted into the document.
The final illustrations show how a graphic link has been inserted into a table cell used in a directory merge.
The add-in includes a second major function, the first item in the drop down section of the Ribbon group. The purpose of this function is to replace display texts in a document, with hyperlinks that relate to those display texts, from an Excel data file that includes the display text, the URL to be linked to and optionally a screen tip text.
The document being processed could be the result of a mail merge or a document that has a variety of texts that need to be hyperlinked. It cannot be a merge document.
This part of the add-in evolved separately, but as it is so closely related to the mail merge function and shares several code modules, I decided to include it from Version 2 in the same add-in as the mail merge function.
The function has a separate but similar userform as shown below.
The example shown below is a simple directory merge document. It features a simple description and a code that relates to the description. When merged to a new document, you get a list of the merged items and their codes (I have only shown the beginning of the list).
The function can be used to replace the codes (or the descriptions, or - in two operations - both) with hyperlinks to the web pages etc. that relate to those codes or descriptions.
This process, a more recent addition, was prompted by a user who reported that the hyperlink merge link text did not survive being merged to the bodies of e-mailed documents. To overcome this I came up with an option to merge a document that had been merged, and which included hyperlink merge fields created with this add-in, to the bodies of e-mailed messages.
To use the process, ensure that the merge document has the e-mail address field at the end of the document followed by a paragraph break. This is used to address the individual messages
Merge the document to a new document ( Mailings Tab > Finish and Merge > Edit Individual Documents)
Then run the process from the add-in's Menu.
After checking to ensure that the merged document is valid for the process, the following dialog is displayed:
The check box has been added to allow the user to check that merge works as intended by merging and displaying only the first three records. This is the default setting.
This add-in was originally developed to help overcome the difficulty of using merged hyperlinks with variable display texts.