![]() |
|
|
|
#1
|
|||
|
|||
|
I have created a mail merge letter template that uses Quick Parts Fields such as MergedField and Hyperlink to write my letter using ALT F9 to see the fields. I am having an issue inserting email addresses to have the correct hyperlink when clicked after the mail merge is complete. The text is displayed correctly from the merge; so that the email address is blue and underlined, but when you hoover over the link or try to control click on the link it says that the link is not valid. I have tried to find a Quick Parts email address field or modify the Hyperlink field to include "mailto:" which does correct the issue but then the words mailto: show up in my final document.
I have a 200 page document with multiple references of different email addresses and they all need to be clickable hyperlink email addresses. Does anyone know how to accomplish this? |
|
#2
|
||||
|
||||
|
You could insert the email addresses as plain text, then use a macro like the following to convert them (and any web addresses) to clickable hyperlinks post-merge.
Code:
Sub MakeLinks()
Application.ScreenUpdating = False
With ActiveDocument
With .Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "<[0-9A-ÿ.\-]{1,}\@[0-9A-ÿ\-.]{1,}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchWildcards = True
.Execute
End With
Do While .Find.Found
.Duplicate.AutoFormat
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
With .Range
With .Find
.Text = "http://[! ]{1,}"
.Execute
End With
Do While .Find.Found
.Duplicate.AutoFormat
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
|||
|
|||
|
Is there any other way beside a Macro to accomplish this? It is a document that will be used by over 50 people and majority of them do not know how to use a macro.
Please let me know if anyone has any ideas. Thanks. |
|
#4
|
||||
|
||||
|
If you change:
Code:
Sub MakeLinks() Application.ScreenUpdating = False Code:
Sub MailMergeToDoc() Application.ScreenUpdating = False ActiveDocument.MailMerge.Destination = wdSendToNewDocument ActiveDocument.MailMerge.Execute There is another way, too, but it takes a fair bit of work to implement. Once it's set up though, no further user interaction is required. It also has the advantage of allowing you to have a display text that differs from the URL/Email address. See the Mailmerge Hyperlink ‘Click Here’ Insertion topic in the Mailmerge Tips & Tricks thread: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Tags |
| email address hyperlink |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Urgent Supprt Need to Create Mail Merge letter
|
risnasmhd | Mail Merge | 1 | 09-29-2013 08:11 PM |
| Mail Merge Many URLs in one email by common email address | instantaphex | Mail Merge | 3 | 04-29-2013 05:46 PM |
Split multi-page mail merge document, then name file from letter info.
|
BriMan83 | Mail Merge | 1 | 04-24-2013 11:35 PM |
Inserting pages at the end of a mail merge
|
morten_lysgaard | Mail Merge | 3 | 07-25-2011 11:19 PM |
| Inserting a Hyperlink and Rich Text in Groupwise Email | cksm4 | Word VBA | 0 | 03-07-2011 06:33 PM |