How to Remove Hyperlinks from Documents


Documents may contain hyperlinks to other documents or web pages. Hyperlinks typically appear as blue underlined text strings.To manually delete a single hyperlink from a document, right-click the hyperlink, point to Hyperlink on the shortcut menu, and then click Remove Hyperlink.
If you want to delete all hyperlinks in a document, you can use a Visual Basic for Applications macro to do this. The following sample Visual Basic for Applications macro removes all hyperlinks in a document.
NOTE: In the following sample macro, only the link is removed. The text of the hyperlink remains in the document.

Sub RemoveHyperlinks()

Dim oDoc As Document
Dim oStory As Range
Dim oHlink As Hyperlink
For Each oStory In ActiveDocument.StoryRanges
    For Each oHlink In oStory.Hyperlinks
        oHlink.Delete
    Next
Next
End Sub
                                               
To remove all traces of both the hyperlink and the text of the hyperlink from the document, you can use the following sample macro instead.
Sub RemoveAllHyperlinks()
Dim oDoc As Document
Dim oStory As Range
Dim oHlink As Hyperlink
For Each oStory In ActiveDocument.StoryRanges
    For Each oHlink In oStory.Hyperlinks
        oHlink.Range.Delete
    Next
Next
End Sub

Related posts:

  1. How to Remove Your User Name from Your Documents
  2. How to Remove Headers and Footers from Documents
  3. How to Search for and Remove Text Formatted As Hidden
  4. How to Remove Personal Summary Information
  5. How to Remove Personal Summary Information When Connected to a Network

Previous post:

Next post: