Reply
 
Thread Tools Display Modes
  #1   Report Post  
Ted Shoemaker
 
Posts: n/a
Default How advanced is the "replace" function in Word 2000?


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

  #2   Report Post  
Anne Troy
 
Posts: n/a
Default

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



  #3   Report Post  
SVC
 
Posts: n/a
Default

Try this link:

http://word.mvps.org/FAQs/General/Fi...Characters.htm

"Ted Shoemaker" wrote:


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


  #4   Report Post  
Jay Freedman
 
Posts: n/a
Default

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



  #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







  #6   Report Post  
Klaus Linke
 
Posts: n/a
Default

Hi Ted,

Probably you have discovered by now that you can find red text by going into
"Format Font" in the "Edit Replace" dialog?
You can just leave the "Find what" text empty if you want to search some
formatting.

If you want to replace the red text with the text "Robin", you put "Robin"
in "Replace with". You can apply some other color (say, "automatic") at the
same time, again by choosing that in "Format Font" while the cursor is in
"Replace with".

If you want to add "Robin" in front of any red text, you'd put "Robin^&" in
"Replace with".
^& will insert the found text. You don't have to remember the placeholder
^&: It's listed among other text when you click on the "Special" button.

Searching for some font would work the same. Searching for a certain
location on the page isn't so simple, but you can search for special
formatting or special characters that determine the location (say "page
break before" in the paragraph format, or manual page breaks, column breaks,
line breaks, ...), or you can limit your search to specific regions (say
footnotes or comments).

Regards,
Klaus


"Ted Shoemaker" wrote:

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



  #7   Report Post  
 
Posts: n/a
Default

Good stuff here. Thanks for all replies.

Ted Shoemaker

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 advanced is the "replace" function in Word 2000? Ted Shoemaker Microsoft Word Help 6 July 9th 05 02:17 PM
Does Word have Keyboard Merges like Word Perfect does? Donnas Mailmerge 1 June 28th 05 09:30 PM
Word2000 letterhead merge BAW Mailmerge 3 June 25th 05 01:17 PM
Locking Two Words Together to Make a Proper Compound Noun in Word WorkingWoman Microsoft Word Help 2 April 7th 05 02:33 PM
letters - ask/fillin Caroline H New Users 2 February 25th 05 08:19 PM


All times are GMT +1. The time now is 08:20 PM.

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"