View Single Post
 
Old 03-28-2012, 02:59 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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,

With the code I posted, I was actually being careful to not 'unmake' the hyperlinks! Try:
Code:
Sub TagHyperlinks()
Dim i As Long
With ActiveDocument
  For i = .Hyperlinks.Count To 1 Step -1
    With .Hyperlinks(i)
      .Range.InsertBefore "<a target=""_blank"" href=""" & .Address & """>"
      .Range.InsertAfter "</a>"
      .Range.Fields(1).Unlink
    End With
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 03-28-2012 at 03:00 PM. Reason: Code fix.
Reply With Quote