View Single Post
 
Old 03-27-2012, 10:31 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,384
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Eric,

Try:
Code:
Sub TagHyperlinks()
Dim HLnk As Hyperlink
For Each HLnk In ActiveDocument.Hyperlinks
  HLnk.Range.InsertBefore "<a target=""_blank"" href=""" & HLnk.Address & """>"
  HLnk.Range.InsertAfter "</a>"
Next
End Sub
To use it, you can simply add 'Call TagHyperlinks' at the appropriate place in your existing code.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote