macro remove hyperlinks while keep text blue

J

Jack

Re Word 97 ----

I've got a macro for removing hyperlinks, but does anyone have a macro for removing hyperlinks while at the same time keeping that text colored blue?


Sincerely,
Jack
 
B

Bob I

The hyperlinks are shown in blue because hyperlinks have been set to
display in blue. If you want the plain text to be BLUE, you will need to
edit the macro to CHANGE the selected text to BLUE, since you are
removing the attribute that caused them to display in blue.
 
J

Jack

Bob,

Yes, but I don't how to do it.

Jack





The hyperlinks are shown in blue because hyperlinks have been set to
display in blue. If you want the plain text to be BLUE, you will need to
edit the macro to CHANGE the selected text to BLUE, since you are
removing the attribute that caused them to display in blue.
 
M

Milly Staples - MVP Outlook

Are you recording a macro or writing one from code? If simply recording the
macro, at the end of the macro recording, select the text, use the color
button on the toolbar to select the color blue, then end the recording.

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Jack asked:

| Bob,
|
| Yes, but I don't how to do it.
|
| Jack
|
|
|
|
|
| | The hyperlinks are shown in blue because hyperlinks have been set to
| display in blue. If you want the plain text to be BLUE, you will need
| to edit the macro to CHANGE the selected text to BLUE, since you are
| removing the attribute that caused them to display in blue.
|
| Jack wrote:
|| Re Word 97 ----
||
|| I've got a macro for removing hyperlinks, but does anyone have a
|| macro for removing hyperlinks while at the same time keeping that
|| text colored blue?
||
||
|| Sincerely,
|| Jack
 
J

Jack

Well, I really need the code, because, all I've really done for this macro
(remove hyperlinks), if I remember right, is to use the one available in
Word and assign it to a button -- it was a few years ago and now I'm not
sure exactly how I did it.

Jack


"Milly Staples - MVP Outlook" <[email protected]>
wrote in message Are you recording a macro or writing one from code? If simply recording the
macro, at the end of the macro recording, select the text, use the color
button on the toolbar to select the color blue, then end the recording.

--
Milly Staples [MVP - Outlook]

Post all replies to the group to keep the discussion intact. All
unsolicited mail sent to my personal account will be deleted without
reading.

After furious head scratching, Jack asked:

| Bob,
|
| Yes, but I don't how to do it.
|
| Jack
|
|
|
|
|
| | The hyperlinks are shown in blue because hyperlinks have been set to
| display in blue. If you want the plain text to be BLUE, you will need
| to edit the macro to CHANGE the selected text to BLUE, since you are
| removing the attribute that caused them to display in blue.
|
| Jack wrote:
|| Re Word 97 ----
||
|| I've got a macro for removing hyperlinks, but does anyone have a
|| macro for removing hyperlinks while at the same time keeping that
|| text colored blue?
||
||
|| Sincerely,
|| Jack
 
B

Bob I

In that case. Select the hyperlink,Tools, Macro, Record a macro, (pick
your macro name) then for your macro steps, Format, Font, color it Blue,
Apply, OK, then pick your other macro, and then stop recording.
 
J

Jack

Hi Bob,

When I "color" the hyperlink to blue (or red or any color), then remove
hyperlinks, the now defunct hyperlink turns to black.

:(
Jack


In that case. Select the hyperlink,Tools, Macro, Record a macro, (pick
your macro name) then for your macro steps, Format, Font, color it Blue,
Apply, OK, then pick your other macro, and then stop recording.
 
J

Jack

Yes -- if you try it, you'll see that all the text in the document is always
selected when doing Remove Hyperlink.

Jack


Is the text still selected after the "hyperlink" is gone?
 
B

Bob I

In that case when you record the New macro, click your "remove
hyperlink" button first, and then perform the the "change color" steps.
 
J

Jack

Bob,

I don't see how that will work.
Let's assume I have a document that is 12 pages and full of hyperlinks.
I remove all the hyperlinks in one basic action.
Then what? I find one and change the font color to blue? And the next time
I have a document full of hyperlinks, and remove all the hyperlinks, I can't
imagine how it will then determine which one were hyperlinks and color them
blue!?
Am I missing something? Can you, yourself, actually do it?

Jack



In that case when you record the New macro, click your "remove
hyperlink" button first, and then perform the the "change color" steps.
 
B

Bob I

Ah I'm starting to see where the problem is. I was under the impression
your macro did one at a time. If the "macro" you're using is a find all
replace then the "text color change" will never have a chance to work.
You will need to set it up so it finds the first, "de-hyperlinks" it,
changes color of the selected text, finds the next, etc.
 
J

Jack

Yeah, that's where I'm stuck -- I don't see how to do that, especially since
the current macro is merely taken from the Word commands that already exist.


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


Ah I'm starting to see where the problem is. I was under the impression
your macro did one at a time. If the "macro" you're using is a find all
replace then the "text color change" will never have a chance to work.
You will need to set it up so it finds the first, "de-hyperlinks" it,
changes color of the selected text, finds the next, etc.
 
B

Bob I

The macro has to have a name so you should be able to go in and look at
it and edit it.

Here is one that makes the selected text blue. The operative part is
between With and End With.

Sub MakeBlue()
'
' MakeBlue Macro
' Macro recorded 5/2/2006 by OC
'
With Selection.Font

.Color = wdColorBlue

End With
End Sub
 
J

Jack

Bob,

Here is the Word 97 macro for removing hyperlinks:

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

I can't seem to get your code inserted right to make it work for keeping the
hyperlinked text blue after the hyperlinks are removed. How should it be?


Jack

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


The macro has to have a name so you should be able to go in and look at
it and edit it.

Here is one that makes the selected text blue. The operative part is
between With and End With.

Sub MakeBlue()
'
' MakeBlue Macro
' Macro recorded 5/2/2006 by OC
'
With Selection.Font

.Color = wdColorBlue

End With
End Sub
Yeah, that's where I'm stuck -- I don't see how to do that, especially
since
the current macro is merely taken from the Word commands that already
exist.


Jack
[/QUOTE]
[/QUOTE]
 
B

Bob I

Humm, I'm working with 2003 and Visual Basic. What Sub routine do you
get if you record a macro to change a selection of text to blue?
(Ctrl+F9 inserts a field here and really boluxes up the document :))
Bob,

Here is the Word 97 macro for removing hyperlinks:

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

I can't seem to get your code inserted right to make it work for keeping the
hyperlinked text blue after the hyperlinks are removed. How should it be?


Jack

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


The macro has to have a name so you should be able to go in and look at
it and edit it.

Here is one that makes the selected text blue. The operative part is
between With and End With.

Sub MakeBlue()
'
' MakeBlue Macro
' Macro recorded 5/2/2006 by OC
'
With Selection.Font

.Color = wdColorBlue

End With
End Sub

Jack wrote:
 
J

Jack

Bob,

Word 97 uses Visual Basic too.
What Sub routine do you get if you record a macro to change a selection of
text to blue?<
Here is what you get when some text is already highlighted before recording
the macro:

Public Sub MAIN()
WordBasic.EditReplace Find:="^l^l", Replace:="^p^p", Direction:=0,
MatchCase:=0, WholeWord:=0, PatternMatch:=0, SoundsLike:=0, ReplaceAll:=1,
Format:=0, Wrap:=2, FindAllWordForms:=0
End Sub
Sub ReplaceDblMLBwDblParaMarks()
'
' ReplaceDblMLBwDblParaMarks Macro
' Replace double manual line breaks with double paragraph marks
'

End Sub
Sub MakeTextBlue()
'
' MakeTextBlue Macro
' Macro recorded 05/03/06
'
With Selection.Font
.Name = "Times New Roman"
.Size = 10
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.ColorIndex = wdBlue
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
End With
End Sub


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



Humm, I'm working with 2003 and Visual Basic. What Sub routine do you
get if you record a macro to change a selection of text to blue?
(Ctrl+F9 inserts a field here and really boluxes up the document :))
Bob,

Here is the Word 97 macro for removing hyperlinks:

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

I can't seem to get your code inserted right to make it work for keeping
the
hyperlinked text blue after the hyperlinks are removed. How should it be?


Jack

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


The macro has to have a name so you should be able to go in and look at
it and edit it.

Here is one that makes the selected text blue. The operative part is
between With and End With.

Sub MakeBlue()
'
' MakeBlue Macro
' Macro recorded 5/2/2006 by OC
'
With Selection.Font

.Color = wdColorBlue

End With
End Sub

Jack wrote:
 
J

Jack

I think the trick is to some how have just all the hyperlinks highlighted/selected, and then have them converted, and then have them made blue. Now, the code for that is another thing!

Jack
 
B

Bob I

here is the operative part from yours vs. mine. You have
".ColorIndex = wdBlue" while mine is ".Color = wdColorBlue"

Try using yours

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

.ColorIndex = wdBlue

End With
End Sub
Bob,

Word 97 uses Visual Basic too.
What Sub routine do you get if you record a macro to change a selection of
text to blue?<

Here is what you get when some text is already highlighted before recording
the macro:

Public Sub MAIN()
WordBasic.EditReplace Find:="^l^l", Replace:="^p^p", Direction:=0,
MatchCase:=0, WholeWord:=0, PatternMatch:=0, SoundsLike:=0, ReplaceAll:=1,
Format:=0, Wrap:=2, FindAllWordForms:=0
End Sub
Sub ReplaceDblMLBwDblParaMarks()
'
' ReplaceDblMLBwDblParaMarks Macro
' Replace double manual line breaks with double paragraph marks
'

End Sub
Sub MakeTextBlue()
'
' MakeTextBlue Macro
' Macro recorded 05/03/06
'
With Selection.Font
.Name = "Times New Roman"
.Size = 10
.Bold = False
.Italic = False
.Underline = wdUnderlineNone
.StrikeThrough = False
.DoubleStrikeThrough = False
.Outline = False
.Emboss = False
.Shadow = False
.Hidden = False
.SmallCaps = False
.AllCaps = False
.ColorIndex = wdBlue
.Engrave = False
.Superscript = False
.Subscript = False
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
.Animation = wdAnimationNone
End With
End Sub


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



Humm, I'm working with 2003 and Visual Basic. What Sub routine do you
get if you record a macro to change a selection of text to blue?
(Ctrl+F9 inserts a field here and really boluxes up the document :))

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