I have a document which has hundreds of hyperlinks in it. Is there any way to remove them all in one go?
Alan
I have a document which has hundreds of hyperlinks in it. Is there any way to remove them all in one go?
Alan

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
Yes, use a macro which contains lines like this
While ActiveDocument.Hyperlinks.Count > 0
ActiveDocument.Hyperlinks(1).Delete
Wend
Andrew Lockton, Chrysalis Design, Melbourne Australia
alan sh (2012-03-21)
Sorted - many thanks.
Alan
I spoke too soon. I'm gettin a run time error - "method delete of object Hyperlink failed"
More info. It appears to have deleted about 100 of them, but there are still about 1400 left. I have tried to manually delete the first few that I have found, but it still fails with the same message.
Alan
Last edited by alan sh; 2012-03-21 at 07:44.
You might need to post a sample of the file so we can see what the problem is. If manually removing the Hyperlink is not possible then the macro is going to encounter problems.
Is there something special about the hyperlinks that are still there? Is formatting important or could you convert the content to text by doing a cut/paste special?
Are the hyperlinks you can't delete sitting in text frames or header/footers?
Andrew Lockton, Chrysalis Design, Melbourne Australia
I have no idea. I can delete them manually. Let me have a look and see if there is one in a text frame or picture or something weird.
Thanks
Alan
Without seeing a sample, I don't know what is going on - that code should have worked.
Perhaps we should address the reason you want to remove the hyperlinks - is it just for visual reasons or is there a problem with the hyperlink data itself?
Typically a hyperlink is formatted with a character style so it is easy to remove that by resetting the font formatting (Ctrl-Space).
Andrew Lockton, Chrysalis Design, Melbourne Australia
I have fixed it with your help above. There was a hyperlink embedded inside a box underneath a diagram (or inside it). It was removable manually by deleting the object. But you couldn't get to the object itself to remove the hyperlink.
The reason to remove them? They pointed to pages on the internet - which means offline reading was no good. So, I'm redoing it all.
Anyway, problem solved and it's full steam ahead again. Once again, many thanks for your help.
regards
Alan
If you only need to break the links, Ctrl-A, then Ctrl-Shift-F9 will do that. This leaves the hyperlinks' text in-situ.
Cheers,
Paul Edstein
[MS MVP - Word]