Removing Text and Hyperlink

  • Thread starter Thread starter Rajesh M Kanneganti
  • Start date Start date
R

Rajesh M Kanneganti

Hello group

I have some hyperlinks in my document which I want to get rid off. There are
about 50 of them and to remove them manually its gonna take forever. So how
do I remove them? I want to remove the hyperlink and the text as well. All
of those hyperlinks point to one single domain but different pages. I just
need to get rid of all of them. I've tried using the replace command but I
was not sure what to do.

Can anybody assist?

Thanks

Raj
 
Hi, Raj,

The Replace command is the right method. Before you give the command,
press Alt+F9 to display all field codes.

In the Find What box, type

^d HYPERLINK

(there's a space between the d and the H). Leave the Replace With box
blank, and press the Replace All button. Finally, press Alt+F9 again
to collapse any remaining fields.
 
When I used Jay's method I end up deleting the hyperlinked text as well as the hyperlink. Is there a way to ditch the links after the document is created while keeping the link text? I mean just the text that appears when fields are not displayed
I can replaced the character style for hyperlink with direct formatting or the Default Character Font character style in the search, but this still leaves the hyperlink option
I generally stop unwanted hyperlinks as they happen or turn off the AutoFormat as You Type option, if I know there will be a lot of them. But what do you do if you have a lot of them, and you want to eliminate the links only

tj
 
What if I just want to remove a bunch of links but not the text? I tried to post this once before, so I apologize if it comes up twice. I can replace the character style with the default character style, but this leaves the link. If the links are already there, I can't disable the AutoFormat As You Type control

tj
 
Hi, tj,

Here are two alternatives:

- If the hyperlinks are the *only* fields in the document body (remember
that fields include dates, times, page numbers other than ones in
headers/footers, and other things), or if there are other fields but you
don't mind converting them to plain text so they'll never update again, you
can select all (Ctrl+A) and unlink fields (Ctrl+Shift+F9).

- If there are other fields and you need to be selective about changing only
the hyperlinks, use this small macro:

Sub UnlinkHyperlinks()
Dim nHL As Long
For nHL = 1 To ActiveDocument.Hyperlinks.Count
ActiveDocument.Hyperlinks(1).Delete
Next nHL
End Sub

If you need instructions to use the macro, see
http://www.gmayor.com/installing_macro.htm.

[It seems a bit odd to me that .Delete in the macro does the same as Unlink
from the keyboard, removing the hyperlink-ness and leaving the display text.
It's "just one of those things."]
 
Your original post was misleading: you said you wanted to remove the
hyperlinks entirely, text and all, and that's what Jay's method was designed
to do. To merely unlink the hyperlinks, leaving the display text as plain
text (the Hyperlink character style will also be removed), here are two
methods:

1. If you have no other fields in the document, Ctrl+A, then Ctrl+Shift+F9.
This unlinks all fields and converts them to plain text.

2. If you have other fields, you'll have to do this selectively, but it can
be done fairly quickly.
a. Click on the Select Browse Object button (round button between the
double-headed browse arrows at the bottom of the vertical scroll bar) and
choose Browse by Field.
b. Starting at the top of the document, click on the down arrow (which
will now be Next Field). If the field you have arrived at is a hyperlink,
press Ctrl+Shift+F9 to unlink it.
c. Click Next Field again. If the field you have come to is a hyperlink,
press F4 to repeat the unlinking. If not, browse to the next field.
d. Keep alternating Next Field and F4 till you've done them all.

I'm sure someone here can provide you with a macro that will find and unlink
just the HYPERLINK fields, but you can do it this way before one of them
gets back here to post! . . . Whoops! I see Jay has beat me to it, but
that's because you started a new thread. Naughty, naughty!

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

tjtjjtjt said:
When I used Jay's method I end up deleting the hyperlinked text as well as
the hyperlink. Is there a way to ditch the links after the document is
created while keeping the link text? I mean just the text that appears when
fields are not displayed.
I can replaced the character style for hyperlink with direct formatting or
the Default Character Font character style in the search, but this still
leaves the hyperlink option.
I generally stop unwanted hyperlinks as they happen or turn off the
AutoFormat as You Type option, if I know there will be a lot of them. But
what do you do if you have a lot of them, and you want to eliminate the
links only?
 
Ah. "tjtjjtjt" snipped the quoted material, so I could not see the original
post, and I use OE with "Hide Read Messages" enabled, so I didn't notice he
wasn't the OP.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Sorry about the repost. My browser stopped showing any new posts. So, I thought I'd managed to not post the first one--the one you responded to. Oddly, it took until about 20 minutes ago for me to be able to see new posts--that is, any posts made after midnight last night-- (I've been trying since before 9 this morning). Restarting didn't help. I had just gotten a response back from Microsoft in which they requested more information when I checked again and I could see posts from today

tj
 
Thank you Jay and Suzanne. Sorry about any confusion in the posts. I wasn't seeing new posts from around 9 this morning until 5 this after

tj
 
Back
Top