macro remove hyperlinks while keep text blue

J

Jack

Bob,
your Macro seems to select all text?<

Yes.
The remove hyperlink macro is

Public Sub MAIN()
Dim variable
WordBasic.EditSelectAll
UserFunction (variable)
End Sub
Private Sub UserFunction(variable)
WordBasic.SendKeys "^+{F9}"
End Sub

and it selects all text. Therefore, I don't where to include:

Sub MakeTextBlue()
'
' MakeTextBlue Macro
' Macro recorded 05/03/06
'
With Selection.Font

.ColorIndex = wdBlue

End With
End Sub


Jack

----------------------------------------------




That's what I thought was happening, but your Macro seems to select all
text?
 
B

Bob I

I don't know if this will work for 97 but what I did here was to create
a "bluetext" style, and did a find and replace for Format: Style:
Hyperlink, with the "bluetext" style. Then when I did a "delete
hyperlink" the blue text was not removed. Is this an option in 97?
 
J

Jack

Bob,

Let me have the code and I'll try it!


Jack
-------------------------------------------


I don't know if this will work for 97 but what I did here was to create
a "bluetext" style, and did a find and replace for Format: Style:
Hyperlink, with the "bluetext" style. Then when I did a "delete
hyperlink" the blue text was not removed. Is this an option in 97?
 
B

Bob I

I just did it manually go to, Format, Styles and Formatting, New Style,
(base it on Normal paragraph font and change it to have Blue text and
name it "Bluetext") Then with the "Find/Replace" menu, for Find go to
More, and pick Format, Style, and Hyperlink, and for Replace do the
same thing but pick your "Bluetext" style. Then do Replace All. Then try
your Hyperlink remover.
 
J

Jack

Bob,

When I do the Bluetext thing, all my text turns blue -- not just the
hyperlink (which is already blue, of course).

However, I can make all the hyperlinks highlighted, and then remove all
hyperlinks. But then that text is highlighted, and there does not appear to
be a command to remove all highlighting. I feel like I'm getting close :)


Jack

-------------------------------------------



I just did it manually go to, Format, Styles and Formatting, New Style,
(base it on Normal paragraph font and change it to have Blue text and
name it "Bluetext") Then with the "Find/Replace" menu, for Find go to
More, and pick Format, Style, and Hyperlink, and for Replace do the
same thing but pick your "Bluetext" style. Then do Replace All. Then try
your Hyperlink remover.
 
J

Jack

Well actually I can remove the highlight on everything with the highlight
button.

I'd rather not have to remove highlights (in case some non-hyperlink parts
of the document were originally highlighted) and just do with the blue text,
of course. I wonder why that's not working for me.


Jack



Bob,

When I do the Bluetext thing, all my text turns blue -- not just the
hyperlink (which is already blue, of course).

However, I can make all the hyperlinks highlighted, and then remove all
hyperlinks. But then that text is highlighted, and there does not appear to
be a command to remove all highlighting. I feel like I'm getting close :)


Jack

-------------------------------------------



I just did it manually go to, Format, Styles and Formatting, New Style,
(base it on Normal paragraph font and change it to have Blue text and
name it "Bluetext") Then with the "Find/Replace" menu, for Find go to
More, and pick Format, Style, and Hyperlink, and for Replace do the
same thing but pick your "Bluetext" style. Then do Replace All. Then try
your Hyperlink remover.
 
B

Bob I

In the Find/Replace it should locate and change each instance of
"hyperlink" format style to "bluetext" format style. If I have 5
hyperlinks, I get "made 5 replacements", and while the Hyperlinks are
still Blue, the "underline" goes away. As for the "highlighting", is
that the "selected text" highlighting?
 
J

Jack

Bob,

I finally got it to work!!

There was one step I realized I needed to add to
go to, Format, Styles and Formatting, New Style,
(base it on Normal paragraph font and change it to have Blue text and
name it "Bluetext")

and that was choosing "Character" instead of the default "Paragraph" under
Style Type.

Hey, you really hung in there with me as I banged around on this -- I don't
think I would have made it without your encouragement -- thanks!
As for the "highlighting", is that the "selected text" highlighting?<

That is the highlighting you get with the Highlight button (chooses a color
to highlight around the text that is selected).
So, Replace With/ Format/ Highlight
Of course, the Highlight button needs to have been set to a color.


Well, now I'm going to try and put this into a macro and a button!

:)
Jack

-------------------------------------------


In the Find/Replace it should locate and change each instance of
"hyperlink" format style to "bluetext" format style. If I have 5
hyperlinks, I get "made 5 replacements", and while the Hyperlinks are
still Blue, the "underline" goes away. As for the "highlighting", is
that the "selected text" highlighting?
 
J

Jack

Well, I got it into a macro and after some editing it finally works.

I thought I could go to the Word menu
View/Toolbars/Customize/Commands/Macros and find my macro and make a button
for it, but it doesn't appear there!?! I don't see it under All Commands
either.

How do I make a button for it?

Jack
 
J

Jack

OK, never mind -- my macro is listed under
View/Toolbars/Customize/Commands/Macros

HOWEVER, the dialog box is so small, that by the time Word had prefaced my
new macro with NORMAL.NEWMACROS. that my new macro was essentially
indistinguishable from another because the entry line for the name is too
short and the name of the macro does not get fully displayed -- not by a
long shot. Why would the dialog box be designed so small!!!!!!


Jack
 
B

Bob I

Congratulations! Glad to hear you are successful!
Bob,

I finally got it to work!!

There was one step I realized I needed to add to



and that was choosing "Character" instead of the default "Paragraph" under
Style Type.

Hey, you really hung in there with me as I banged around on this -- I don't
think I would have made it without your encouragement -- thanks!




That is the highlighting you get with the Highlight button (chooses a color
to highlight around the text that is selected).
So, Replace With/ Format/ Highlight
Of course, the Highlight button needs to have been set to a color.


Well, now I'm going to try and put this into a macro and a button!

:)
Jack

-------------------------------------------


In the Find/Replace it should locate and change each instance of
"hyperlink" format style to "bluetext" format style. If I have 5
hyperlinks, I get "made 5 replacements", and while the Hyperlinks are
still Blue, the "underline" goes away. As for the "highlighting", is
that the "selected text" highlighting?

Jack wrote:
 

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