Re: Select words with specific attributes/color
From: Helmut Weber (elmkqznfwvccbf_at_mailinator.com)
Date: 01/22/05
- Next message: s_krell: "underline"
- Previous message: Doug Robbins: "Re: Equation numbering macro?"
- In reply to: Hari Prasadh: "Re: Select words with specific attributes/color"
- Next in thread: Hari Prasadh: "Re: Select words with specific attributes/color"
- Reply: Hari Prasadh: "Re: Select words with specific attributes/color"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 22 Jan 2005 23:19:33 +0100
Hi Hari,
probably, you are looking for something like this:
Sub Makro17()
Dim rTmp As Range
Set rTmp = ActiveDocument.Range
resetsearch
With rTmp.Find
.Text = "<Sub>"
.MatchWildcards = True
While .Execute
rTmp.Select
Selection.Bookmarks("\para").Select
Selection.Font.Bold = True
Wend
End With
resetsearch
End Sub
Public Sub ResetSearch()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
' plus some more
.Execute
End With
End Sub
Which means:
reset search options
search for "sub" as a whole word,
select the paragraph it is in,
format the selection as bold
reset search options
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
- Next message: s_krell: "underline"
- Previous message: Doug Robbins: "Re: Equation numbering macro?"
- In reply to: Hari Prasadh: "Re: Select words with specific attributes/color"
- Next in thread: Hari Prasadh: "Re: Select words with specific attributes/color"
- Reply: Hari Prasadh: "Re: Select words with specific attributes/color"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|