For example:
Sub ToggleURLs()Dim RngStry As Range, HLnk As Hyperlink
For Each RngStry In ActiveDocument.StoryRanges
Select Case RngStry.StoryType
Case wdEndnotesStory, wdFootnotesStory, wdMainTextStory
For Each HLnk In RngStry.Hyperlinks
With HLnk
If .TextToDisplay = "url" Then
.TextToDisplay = .Address
Else
.TextToDisplay = "url"
End If
End With
Next
End Select
Next
End Sub
PS: You don't actually need any code to toggle between the hyperlink display and the URL - all you need do is press Alt-F9.