Sie sind auf Seite 1von 1

Remove all hyperlinks with VBA

You can use the following VBA to remove all hyperlinks in Word.
1. Press Alt-F11 to open the Microsoft Visual Basic for Application window;
2. Click Insert > Module, and then copy and paste the follow VBA code into the M
odule window.
3. Then click Run Sub button to run the script.
VBA Code 1: Remove all hyperlinks of current document
Sub KillTheHyperlinks()
' -----------------------------------------------
' Removes all hyperlinks from the document:
' Text to display is left intact
' -----------------------------------------------
With ThisDocument
' Loop while there are hyperlinks afoot!
While .Hyperlinks.Count > 0
.Hyperlinks(1).Delete
Wend
End With
' Shut this off, don't need anymore popping up
Application.Options.AutoFormatAsYouTypeReplaceHyperlinks = False
End Sub
Different to the first VBA code, which removes all hyperlinks in only current do
cument, the second VBA code allows you to remove all hyperlinks in all open docu
ments.

Das könnte Ihnen auch gefallen