Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Tom K Tom K is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Tom K Tom K is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wildcard search want to replace only a portion of what is found Larry Microsoft Word Help 1 April 9th 09 05:38 PM
Wildcard search help. please? Ed Microsoft Word Help 2 September 11th 06 08:50 PM
Can I increment list via wildcard search/replace? Ed Microsoft Word Help 4 September 7th 06 02:56 PM
Help with wildcard search, please? Ed New Users 8 July 28th 06 11:18 AM
Help with Wildcard search/replace, please? Ed Microsoft Word Help 1 July 14th 06 12:48 AM


All times are GMT +1. The time now is 09:05 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"