c:\hyperlinks.txt
)
Sub FileHyperlinks() Dim HL As Hyperlink Dim href As String Dim f Set f = CreateObject("Scripting.FileSystemObject").CreateTextFile("c:\hyperlinks.txt", True) For Each HL In ActiveDocument.Hyperlinks href = HL.Address If href <> "" Then f.WriteLine (href) Next HL f.Close End Sub
c:\hyperlinks.txt
c:\hyperlinks.txt
Sub ReplaceHyperlinks() Dim f, A Dim href, s As String Dim HL As Hyperlink Dim HLs As New Collection Set f = CreateObject("Scripting.FileSystemObject").OpenTextFile("c:\hyperlinks.txt") Do While f.AtEndOfStream <> True s = f.Readline If s <> "" Then A = Split(s, Chr$(9)) If A(1) <> "" Then HLs.Add Item:=A(1), Key:=A(0) Loop f.Close On Error Resume Next For Each HL In ActiveDocument.Hyperlinks href = HL.Address If href <> "" Then s = HLs.Item(href) If s <> "" Then HL.Address = s End If Next HL End Sub
More info/questions from: Subject: MSWord-Hyperlinks