Using <Edit><Find> to find and replace hyperlinks

G

Guybo

I have a large document with many hyperlinks. I would like to replace all of
the hyperlinks in that document and keep the text. I cannot find a way to do
this using <Edit><Find>. Is there a way? If not, is there any other way?

I am using Microsoft Office Word 2003 fully patched and undated.
 
S

Suzanne S. Barnhill

If you have field codes displayed, you can search for ^19 HYPERLINK.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
G

Guybo

This workks fine for removing the hyperlinks, but it does not leave the
text.

How can I delete the hyperlink and leave the text?

Guy
 
G

Graham Mayor

The two macros below will unlink Hyperlinks (which leaves the text) or
delete them which doesn't.

Sub UnlinkHyperlinks()
Dim oField As Field
For Each oField In ActiveDocument.Fields
If oField.Type = wdFieldHyperlink Then
oField.Unlink
End If
Next
Set oField = Nothing
End Sub

Sub DeleteHyperlinks()
Dim oHlink As Hyperlink, i As Long
For i = ActiveDocument.Hyperlinks.Count To 1 Step -1
ActiveDocument.Hyperlinks(i).Delete
Next i
End Sub

http://www.gmayor.com/installing_macro.htm


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

I didn't specify what to do when you find the hyperlink! If you are
replacing it with nothing or deleting it, then yes, it's gone. But you can
equally well do this:

1. Find the first hyperlink.

2. Close the Find dialog.

3. With the hyperlink selected, press Ctrl+Shift+F9 to unlink it.

4. Use the Find Next browse arrow at the bottom of the vertical scroll bar
to find the next hyperlink.

5. Press F4 to unlink it.

6. Repeat steps 4 and 5 until you don't find any more.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org
 
S

Stephen Larivee

Select all
Ctrl+Shift+F9



Guybo said:
This workks fine for removing the hyperlinks, but it does not leave the
text.

How can I delete the hyperlink and leave the text?

Guy
 
T

Terry Farrell

Ctrl+Shft+F9 (Unlink Fields) is fine if you only have unwanted Hyperlinks in
your document, but unlinking all other fields may not be what is wanted.
Even a humble TOC will become text and will lose its GoToHeading and update
functions.
 

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