Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find all instances of yellow text and change font color to red

Tags:

ms-word

vba

I need a vba macro that searches for all text that has font color as yellow within a MS Word 2007 document and changes it to red. The yellow color won't show in the printouts. Manually selecting and changing will take me hours.

like image 989
Raaskull Avatar asked Sep 11 '10 13:09

Raaskull


People also ask

How do I change the color of my text to red?

Select the text that you want to change. On the Home tab, in the Font group, choose the arrow next to Font Color, and then select a color.

How do I change the color of multiple text in Word?

To change multiple shapes or text boxes, click the first shape or text box, and then press and hold Ctrl while you click the other shapes or text boxes. On the Drawing Tools Format tab, click Text Fill and, under Theme Colors, pick the color you want.

How do you change the color of one text to another color?

Go to Format > Font > Font. + D to open the Font dialog box. Select the arrow next to Font color, and then choose a color. Select Default and then select Yes to apply the change to all new documents based on the template.


1 Answers

Following on from stakx’s Word 97 solution, here’s what works in Word 2010:

  1. Open the Find and Replace dialogue (e.g. Ctrl-H)
  2. Click in the "Find what" box.
  3. Format drop-down, Font, choose the Font color to be found, OK.
  4. Click in the "Replace with" box.
  5. Format drop-down, Font, choose the colour to end up with, OK.
  6. Observe that the Format: description for "Find what" and "Replace with" is now different.
  7. Replace/Replace All/Find Next as desired.

You can determine the original colour as follows:

  1. Click on a bit of text with the original colour
  2. Open the colour palette. If neither a "Theme color" nor a "Standard color" is selected, you may need to click on "More colors".
like image 176
Colin Frame Avatar answered Oct 04 '22 21:10

Colin Frame