View Single Post
  #5   Report Post  
Anne Troy
 
Posts: n/a
Default

LOL! Stupid me. I didn't even notice. Thanks, doll!
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


"Jay Freedman" wrote in message
...
Hi Anne,

There's a bug in the recorder that makes it fail to record the kind of
formatting you're searching for. After the .Text line you need to insert

.Font.Color = wdColorRed

to make it look for red text. This is one of several bugs I wrote about in
http://word.mvps.org/FAQs/MacrosVBA/...ordedMacro.htm.

The macro would also need a loop inserted around the .Execute and

..TypeText
lines to make it find all the occurrences. There would have to be a tricky
little bit at the end of that loop that moves the Selection to a point

after
the red text, so it doesn't keep finding the same red text over and over.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org

Anne Troy wrote:
This (recorded) macro finds the first red-text character in the doc,
backs up a space, inserts "SomeWordHere".

If you wanted to do this continuously, you'll have to get the code
re-worked.

Sub Macro1()
'
' Macro1 Macro
' Macro recorded July 8, 2005 by Anne Troy
'
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^?"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
End With
Selection.Find.Execute
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.TypeText Text:="SomeWordHere "
End Sub
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


"Ted Shoemaker" wrote in message
...

Hello,

I have a long *.doc file in Word 2000. I would like to locate all
the places in that document which use red text, and insert the word
"Robin" there. Is there an easy way to do this? I don't want to
slog through the document myself, line by line. In case it helps,
I'm interested here only in the standard red color, not in the
millions of custom colors.

And let's generalize that question. The "replace" function is set
up to replace text, ignoring font, placement, etc. Suppose I want
to change all occurrences of something without considering the
verbal content of the text itself (e.g. I'm looking for all uses of
a certain font, color, location on the page, etc). Is there a way
of manipulating this?

Probably I'm looking for something other than the "replace" function.

Thank you for all help.

Ted Shoemaker