Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Selection.Hyperlinks(1).TextToDisplay = Selection.Hyperlinks(1).Address
Sub ChangeHyperlinks()
Dim oHyperlink As Hyperlink
For Each oHyperlink In ActiveDocument.Hyperlinks
oHyperlink.TextToDisplay = oHyperlink.Address
Next
End Sub
Row? You never mentioned a row.Thought it is easy by "duplicating" the Hyperlink, adding a paragraph mark before it to have it in the new row, and then searching for something two hyperlinks in a row , where the first one is being replaced by its TextToDisplay value.
Sub ChangeLinkCrap()
Dim strAddress As String
strAddress = Selection.Hyperlinks(1).Address
With Selection
.Hyperlinks(1).Delete
.EndKey Unit:=wdLine
.TypeParagraph
End With
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, _
Address:=strAddress, SubAddress:="", _
ScreenTip:="", TextToDisplay:=strAddress
End Sub[/vba]
Have you tried using the macro recorder? It is true the macro recorder would not work correctly, but it would give you a good idea of what to do.
The reason the macro recorder would not work is that recording does not allow the use of variables. So the values of the Address and TextToDisplay are recorded literally.
Gerry
[url=http://www3.telus.net/public/fumei/]My paintings and sculpture[/url]