# [How To] Remove Hyperlinks in MS Word using Visual Basic

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.

Dim oDoc As Document
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
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.