Macro dưới đây thực hiện việc xóa toàn bộ những URL có trong file Word .
1. Mở file Word có chứa những URL cần xóa
2. Bấm tổ hợp phím ALT_F11 để mở ra cửa sổ Visual Basic
3. Bấm menu Insert > Module sau đó bạn dán theo nội dung dưới đây
Sub FixHyperlinks()
With ActiveDocument
While .Hyperlinks.Count > 0
.Hyperlinks(1).Delete
Wend
End With
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "www"
.Replacement.Text = "www"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
4. Quay trở lại Word và chạy Macro FixHyperlinks ( nếu bạn đang dùng Word 2007 hãy chọn tab Developer , chọn Macro ) .