alfordsteven Posted March 2, 2007 Posted March 2, 2007 Hi, I have downloaded multiple pages of information from the Web and on each line there is a hyperlink. I would like to preserve the text and remove all hyperlinks without going line by line. I tried going into Autocorrect/Autoformat and unchecking the hyperlink box, but this didn't do anything. Any ideas?Thank you very much!Steve
spacesurfer Posted March 6, 2007 Posted March 6, 2007 You can do it with the following macro:Sub removehyperlink()Set myRange = ActiveDocument _ .Range(Start:=ActiveDocument.Content.End - 1)Count = 0For Each aHyperlink In ActiveDocument.Hyperlinks Count = Count + 1 With myRange aHyperlink.Delete End WithNext aHyperlinkEnd Sub
spacesurfer Posted March 6, 2007 Posted March 6, 2007 Here's a shorter code:Sub removeallhyperlinks() For Each myHyperlink In ActiveDocument.Hyperlinks myHyperlink.Delete Next myHyperlinkEnd Sub
alfordsteven Posted March 6, 2007 Author Posted March 6, 2007 Thank you very much! The script works like a charm.Steve
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now