#1   Report Post  
Posted to microsoft.public.word.docmanagement
RPMitchal RPMitchal is offline
external usenet poster
 
Posts: 135
Default replace font color

Word 2003

What I have is a rather lengthy document within which some of the font
colors are other than Black.

What I would like to do is come up with a macro that in essence finds any
font that is NOT Black and change it to Black.

It is my understanding that this can most probably be done with a
find/replace using Wild Cards, but in furthering my VBA education, I would
like to know how it could be done with a VBA Macro.

Thanks in advance - Rod



  #2   Report Post  
Posted to microsoft.public.word.docmanagement
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default replace font color

Hi Rod,

You could use Ctrl-A to select the whole document, then click on the font colour icon on the toolbar (or the font attributes via the
menu) and set the colour to black or auto.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"RPMitchal" wrote in message ...
Word 2003

What I have is a rather lengthy document within which some of the font
colors are other than Black.

What I would like to do is come up with a macro that in essence finds any
font that is NOT Black and change it to Black.

It is my understanding that this can most probably be done with a
find/replace using Wild Cards, but in furthering my VBA education, I would
like to know how it could be done with a VBA Macro.

Thanks in advance - Rod




  #3   Report Post  
Posted to microsoft.public.word.docmanagement
RPMitchal RPMitchal is offline
external usenet poster
 
Posts: 135
Default replace font color

Hey Macropod.

I appreciate you taking the time to respond. However, there are some
instances where I do not want the font color to be changed to Black and to
remain whatever color it may currently be. I would like a macro whereby I
could selectively pick the color(s) that I would like to have changed to
Black.

I would like to be able to do it via macro, as I am embarking on the VBA
learning process and would like to use the resulting macro as a "real world"
learning tool, applicable to my given situation.

With much appreciation - Rod


"macropod" wrote:

Hi Rod,

You could use Ctrl-A to select the whole document, then click on the font colour icon on the toolbar (or the font attributes via the
menu) and set the colour to black or auto.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"RPMitchal" wrote in message ...
Word 2003

What I have is a rather lengthy document within which some of the font
colors are other than Black.

What I would like to do is come up with a macro that in essence finds any
font that is NOT Black and change it to Black.

It is my understanding that this can most probably be done with a
find/replace using Wild Cards, but in furthering my VBA education, I would
like to know how it could be done with a VBA Macro.

Thanks in advance - Rod





  #4   Report Post  
Posted to microsoft.public.word.docmanagement
RPMitchal RPMitchal is offline
external usenet poster
 
Posts: 135
Default replace font color

Cheers Macropod:

I tried using the below to accomplish my goal, but received an error on the
line which reads:

.Font.Color RGB(0, 0, 128)

I was unable to figure out (as of yet) what I am missing to cause the error.
Perhaps you can assist with the below coding.

Thanks Again - Rod

With ActiveDocument.Range.Find
.Format = True
.Text = ""
.Font.Color RGB(0, 0, 128)
.Replacement.Text = ""
.Replacement.Font.Color = RGB(0, 0, 128)
.Execute Replace:=wdReplaceAll
End With
End Sub

"macropod" wrote:

Hi Rod,

You could use Ctrl-A to select the whole document, then click on the font colour icon on the toolbar (or the font attributes via the
menu) and set the colour to black or auto.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"RPMitchal" wrote in message ...
Word 2003

What I have is a rather lengthy document within which some of the font
colors are other than Black.

What I would like to do is come up with a macro that in essence finds any
font that is NOT Black and change it to Black.

It is my understanding that this can most probably be done with a
find/replace using Wild Cards, but in furthering my VBA education, I would
like to know how it could be done with a VBA Macro.

Thanks in advance - Rod





  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default replace font color

I don't know how to do it via VBA, but it's a simple Find/Replace (not even
requiring wildcards) to do manually. Just select Font: Color: Whatever in
the "Find what" box and "Font: Color: Black" in the "Replace with" box,
leaving both boxes empty.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"RPMitchal" wrote in message
...
Word 2003

What I have is a rather lengthy document within which some of the font
colors are other than Black.

What I would like to do is come up with a macro that in essence finds any
font that is NOT Black and change it to Black.

It is my understanding that this can most probably be done with a
find/replace using Wild Cards, but in furthering my VBA education, I would
like to know how it could be done with a VBA Macro.

Thanks in advance - Rod






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default replace font color

Hi Rod,

My response was based on your problem descriptions, which included "finds any font that is NOT Black and change it to Black".

As for a macro, try selecting a coloured word(s) then using the macro recorder to capture your actions as you change the font
colour. Although the code will be unnecessarily verbose, the macro recorder does help you to work out what vba commands you might to
build your own routines. In this case, if only acting on a selected range is what you want, stripping the recorded macro down to the
bare essentials may be all that you need.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"RPMitchal" wrote in message ...
Hey Macropod.

I appreciate you taking the time to respond. However, there are some
instances where I do not want the font color to be changed to Black and to
remain whatever color it may currently be. I would like a macro whereby I
could selectively pick the color(s) that I would like to have changed to
Black.

I would like to be able to do it via macro, as I am embarking on the VBA
learning process and would like to use the resulting macro as a "real world"
learning tool, applicable to my given situation.

With much appreciation - Rod


"macropod" wrote:

Hi Rod,

You could use Ctrl-A to select the whole document, then click on the font colour icon on the toolbar (or the font attributes via
the
menu) and set the colour to black or auto.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"RPMitchal" wrote in message ...
Word 2003

What I have is a rather lengthy document within which some of the font
colors are other than Black.

What I would like to do is come up with a macro that in essence finds any
font that is NOT Black and change it to Black.

It is my understanding that this can most probably be done with a
find/replace using Wild Cards, but in furthering my VBA education, I would
like to know how it could be done with a VBA Macro.

Thanks in advance - Rod






  #7   Report Post  
Posted to microsoft.public.word.docmanagement
RPMitchal RPMitchal is offline
external usenet poster
 
Posts: 135
Default replace font color

Macropod and Suzanne:

Fortunately, I'm aware of your responsive solutions as to how to go about
this, outside of establishing a macro. I guess I've simply got it in my head
that I want to go about this situation via the use of a macro.

I have already completed this portion of my task by using a method (without
a macro) of replacing the colored fonts with Black.

However, I am committed to learning at least the basics of VBA and have been
attempting to write my own code for simple situations that I encounter in
order to get a handle on how VBA works. Which entails using these simple
situations as a way of putting macros together, examining the resulting code
and then referring to my collection of reference books and/or this forum for
additional insight if/when things go awry. With that in mind, I am going to
give Macropod's suggestion a "go" to see if I can work it out that way; using
the "recorder" and taking it from there.

As always, thanks so very much for being "out there" for those of us who
have come to depend upon you.

Happy Thanksgiving to you Suzanne. I know that you're a "Yank" because
you're right next door in Alabama. Atlanta here! :-)

Rod





"Suzanne S. Barnhill" wrote:

I don't know how to do it via VBA, but it's a simple Find/Replace (not even
requiring wildcards) to do manually. Just select Font: Color: Whatever in
the "Find what" box and "Font: Color: Black" in the "Replace with" box,
leaving both boxes empty.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"RPMitchal" wrote in message
...
Word 2003

What I have is a rather lengthy document within which some of the font
colors are other than Black.

What I would like to do is come up with a macro that in essence finds any
font that is NOT Black and change it to Black.

It is my understanding that this can most probably be done with a
find/replace using Wild Cards, but in furthering my VBA education, I would
like to know how it could be done with a VBA Macro.

Thanks in advance - Rod





  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default replace font color

I respect your desire to learn VBA, and your approach is a sound one. I keep
saying I'm going to do that someday "when I have time." g

I'm sure you're aware of the weaknesses of the Macro Recorder, but see
http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm for some advice
on "fixing" recorded macros.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"RPMitchal" wrote in message
...
Macropod and Suzanne:

Fortunately, I'm aware of your responsive solutions as to how to go about
this, outside of establishing a macro. I guess I've simply got it in my

head
that I want to go about this situation via the use of a macro.

I have already completed this portion of my task by using a method

(without
a macro) of replacing the colored fonts with Black.

However, I am committed to learning at least the basics of VBA and have

been
attempting to write my own code for simple situations that I encounter in
order to get a handle on how VBA works. Which entails using these simple
situations as a way of putting macros together, examining the resulting

code
and then referring to my collection of reference books and/or this forum

for
additional insight if/when things go awry. With that in mind, I am going

to
give Macropod's suggestion a "go" to see if I can work it out that way;

using
the "recorder" and taking it from there.

As always, thanks so very much for being "out there" for those of us who
have come to depend upon you.

Happy Thanksgiving to you Suzanne. I know that you're a "Yank" because
you're right next door in Alabama. Atlanta here! :-)

Rod





"Suzanne S. Barnhill" wrote:

I don't know how to do it via VBA, but it's a simple Find/Replace (not

even
requiring wildcards) to do manually. Just select Font: Color: Whatever

in
the "Find what" box and "Font: Color: Black" in the "Replace with" box,
leaving both boxes empty.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the

newsgroup so
all may benefit.

"RPMitchal" wrote in message
...
Word 2003

What I have is a rather lengthy document within which some of the font
colors are other than Black.

What I would like to do is come up with a macro that in essence finds

any
font that is NOT Black and change it to Black.

It is my understanding that this can most probably be done with a
find/replace using Wild Cards, but in furthering my VBA education, I

would
like to know how it could be done with a VBA Macro.

Thanks in advance - Rod






  #9   Report Post  
Posted to microsoft.public.word.docmanagement
RPMitchal RPMitchal is offline
external usenet poster
 
Posts: 135
Default replace font color

Suzanne:

The best of luck to you on that score when you get around to it. Maybe one
day I'll be able to assist you with a dilemma or just answer a question you
may have.

Rod

"Suzanne S. Barnhill" wrote:

I respect your desire to learn VBA, and your approach is a sound one. I keep
saying I'm going to do that someday "when I have time." g

I'm sure you're aware of the weaknesses of the Macro Recorder, but see
http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm for some advice
on "fixing" recorded macros.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"RPMitchal" wrote in message
...
Macropod and Suzanne:

Fortunately, I'm aware of your responsive solutions as to how to go about
this, outside of establishing a macro. I guess I've simply got it in my

head
that I want to go about this situation via the use of a macro.

I have already completed this portion of my task by using a method

(without
a macro) of replacing the colored fonts with Black.

However, I am committed to learning at least the basics of VBA and have

been
attempting to write my own code for simple situations that I encounter in
order to get a handle on how VBA works. Which entails using these simple
situations as a way of putting macros together, examining the resulting

code
and then referring to my collection of reference books and/or this forum

for
additional insight if/when things go awry. With that in mind, I am going

to
give Macropod's suggestion a "go" to see if I can work it out that way;

using
the "recorder" and taking it from there.

As always, thanks so very much for being "out there" for those of us who
have come to depend upon you.

Happy Thanksgiving to you Suzanne. I know that you're a "Yank" because
you're right next door in Alabama. Atlanta here! :-)

Rod





"Suzanne S. Barnhill" wrote:

I don't know how to do it via VBA, but it's a simple Find/Replace (not

even
requiring wildcards) to do manually. Just select Font: Color: Whatever

in
the "Find what" box and "Font: Color: Black" in the "Replace with" box,
leaving both boxes empty.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the

newsgroup so
all may benefit.

"RPMitchal" wrote in message
...
Word 2003

What I have is a rather lengthy document within which some of the font
colors are other than Black.

What I would like to do is come up with a macro that in essence finds

any
font that is NOT Black and change it to Black.

It is my understanding that this can most probably be done with a
find/replace using Wild Cards, but in furthering my VBA education, I

would
like to know how it could be done with a VBA Macro.

Thanks in advance - Rod







Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I make a font one color and the shadow another color? nudough Microsoft Word Help 4 August 10th 07 04:45 PM
Font color different then underline color ducklying Microsoft Word Help 2 April 11th 07 05:28 PM
Font Color and Page View Background Color CassieCC Microsoft Word Help 1 January 8th 07 09:36 PM
How Format Painter could copy the font color of a color text? Miksmith69 Microsoft Word Help 1 August 27th 05 06:43 PM
Font Color Differs Than Chosen Color MAL Microsoft Word Help 1 December 1st 04 09:38 PM


All times are GMT +1. The time now is 11:04 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"