Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
#4
|
|||
|
|||
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 |
#5
|
|||
|
|||
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 |
#6
|
|||
|
|||
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
|
|||
|
|||
Good stuff here. Thanks for all replies.
Ted Shoemaker |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How advanced is the "replace" function in Word 2000? | Microsoft Word Help | |||
Does Word have Keyboard Merges like Word Perfect does? | Mailmerge | |||
Word2000 letterhead merge | Mailmerge | |||
Locking Two Words Together to Make a Proper Compound Noun in Word | Microsoft Word Help | |||
letters - ask/fillin | New Users |