Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search/Replace
I know I have done this once before, but now I can't figure it out
again. Here's the example: I want to do a find/replace on any line that has a 's in the beginning; ie, 'stom 'ssam All I want to do is change all lines that fit this criteria (must start with 's) to a red font. All other lines should be left as is. Anyone have a clue? Thanks |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search/Replace
A macro would do the job
Sub MarkQuotedLines() Dim orng As Range With Selection .HomeKey wdStory Set orng = Selection.Range orng.End = orng.End + 2 If orng.Text = "'s" Then orng.Paragraphs(1).Range.Font.Color _ = wdColorRed End If With .Find .ClearFormatting .Replacement.ClearFormatting .MatchWildcards = True While .Execute("^13's") Set orng = Selection.Range orng.Start = orng.Start + 1 orng.Paragraphs(1).Range.Font.Color _ = wdColorRed Wend End With End With End Sub http://www.gmayor.com/installing_macro.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tom K wrote: I know I have done this once before, but now I can't figure it out again. Here's the example: I want to do a find/replace on any line that has a 's in the beginning; ie, 'stom 'ssam All I want to do is change all lines that fit this criteria (must start with 's) to a red font. All other lines should be left as is. Anyone have a clue? Thanks |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search/Replace
On Apr 21, 1:53*am, "Graham Mayor" wrote:
A macro would do the job And the job it did was perfect! Thank you!! |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Wildcard Search/Replace
You are welcome
-- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Tom K wrote: On Apr 21, 1:53 am, "Graham Mayor" wrote: A macro would do the job And the job it did was perfect! Thank you!! |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Wildcard search want to replace only a portion of what is found | Microsoft Word Help | |||
Wildcard search help. please? | Microsoft Word Help | |||
Can I increment list via wildcard search/replace? | Microsoft Word Help | |||
Help with wildcard search, please? | New Users | |||
Help with Wildcard search/replace, please? | Microsoft Word Help |