How do I remove ALL hyperlinks from a .docx file?

E

Ed S

I imported a file from a Web page and created a Word 2007 .docx file. The
file is loaded with hyperlinks. How can I remove them without doing each
individually? I actually have a number of these files.
 
Y

Yves Dhondt

You could use the following macro which replaces each hyperlink with its
text.

===========
Sub RemoveHyperlinks()
Dim fld As Field
Dim str As String

For Each fld In ActiveDocument.Fields
If fld.Type = wdFieldHyperlink Then
fld.Select
Selection.Text = fld.Result
End If
Next

End Sub
===========

Yves
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top