Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Yet Another Remove Hyperlink Question...

0 views
Skip to first unread message

wklind

unread,
Mar 10, 2006, 4:06:36 PM3/10/06
to

I have several Word macros that can and do delete all hyperlinks in any
Word document. None provide what I am looking for. I need a Word macro
that will delete all external hyperlinks leaving the text in place (but
not preserving any underlines or coloring)... I also need to leave in
place any hyperlinks that are internal (bookmark) hyperlinks. I want
the macro to run without human intervention. No 'yes' or 'no'
questions.


--
wklind

Doug Robbins - Word MVP

unread,
Mar 11, 2006, 3:40:49 AM3/11/06
to
The following will delete hyperlinks, leaving the text in place without
underlines or colouring while preserving cross-references to bookmarks in
the document.

Dim i As Long, hrange As Range, htext As String
With ActiveDocument
For i = .Hyperlinks.Count To 1 Step -1
Set hrange = .Hyperlinks(i).Range
htext = hrange.Text
hrange.Delete
hrange.InsertBefore htext
Next i
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"wklind" <wklind...@news.wordbanter.com> wrote in message
news:wklind...@news.wordbanter.com...

0 new messages