Just what I needed. Thanks.
I wonder if this will work for bookmarks too. I'll try.
Hi Clayton,
Maybe some code like this can do the trick?
----------------------------------------------------------------------------
Sub ReplaceHyperlinks()
Const csSep As String = "#"
Dim oRange As Range
Dim l As Long
Dim sAddress As String
Dim SubAddress As String
Dim sText As String
If ActiveDocument.Hyperlinks.Count > 0 Then
For l = ActiveDocument.Hyperlinks.Count To 1 Step -1
Set oRange = ActiveDocument.Hyperlinks(l).Range
sAddress = ActiveDocument.Hyperlinks(l).Address
SubAddress = ActiveDocument.Hyperlinks(l).SubAddress
sText = ActiveDocument.Hyperlinks(l).TextToDisplay
oRange.Text = sAddress & csSep & SubAddress & csSep & sText
Next l
End If
Set oRange = Nothing
End Sub
----------------------------------------------------------------------------
Hope this helps,
regards,
Astrid
So that all can benefit from the discussion, please post all follow-ups to
the newsgroup.
Visit the MVP Word FAQ site at
http://www.mvps.org/word/
"Clayton L. Wilson" <claytonwilson@ev1.net> schreef in bericht
Not quite what I want. I don't want to delete the links,
just convert the link over to text. That is, I want to
take the link information (link and sublink) and insert it
into the text. For example:
link is "myfile.doc"
sublink is "myanchor"
text is "click here"
After my macro runs text will be "myfile.doc#myanchor
click here"