Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 03-28-2012, 02:59 PM
macropod's Avatar
macropod macropod is offline word macro that reformats embedded links in a doc Windows 7 64bit word macro that reformats embedded links in a doc Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
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
 

Tags
link, macro, vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
word macro that reformats embedded links in a doc Convert html links into embedded hyperlinks njcloud Mail Merge 23 02-04-2020 02:00 PM
word macro that reformats embedded links in a doc Can't open Office 2007 embedded as objects in Word DK8220 Word 5 11-02-2011 01:06 AM
word macro that reformats embedded links in a doc Macro to loop in subfolders, change links, export xml data Catalin.B Excel Programming 2 09-08-2011 11:37 PM
word macro that reformats embedded links in a doc Embedded links spheon Word 1 06-07-2011 04:11 PM
Embedded Excel in Word very slow to update delaneybob Word 0 02-11-2011 10:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft