1
votes

How can I remove all Hyperlinks from a Word document with a VBA macro?

In Excel I can select everything using VBA and use

Selection.Hyperlinks.Delete

Is there something similar in Word?

1

1 Answers

4
votes

You can remove all Hyperlinks from a word document using the following VBA macro.

Sub ClearHyperlinks()

Dim oField As Field

For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next

Set oField = Nothing

End Sub