![]() |
|
#2
|
||||
|
||||
|
Try:
Code:
Sub HiLightGender()
Application.ScreenUpdating = False
Dim StrFnd As String, i As Long
With ActiveDocument.Range.Find
.ClearFormatting
With .Replacement
.ClearFormatting
.Text = "^&"
.Highlight = True
End With
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = True
Options.DefaultHighlightColorIndex = wdTurquoise
StrFnd = "boy,man,male,gentleman,his,he,guy"
For i = 0 To UBound(Split(StrFnd, ","))
.Text = Split(StrFnd, ",")(i)
.Execute Replace:=wdReplaceAll
Next
Options.DefaultHighlightColorIndex = wdPink
StrFnd = "girl,woman,female,lady,her,she,gal"
For i = 0 To UBound(Split(StrFnd, ","))
.Text = Split(StrFnd, ",")(i)
.Execute Replace:=wdReplaceAll
Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
QR-code
|
qrcode | Word | 3 | 05-26-2015 06:38 AM |
code to run once only
|
gerrymac | Word VBA | 6 | 07-26-2014 12:19 AM |
Need Help with Below Code
|
rsrasc | Word VBA | 6 | 04-01-2014 03:42 PM |
Where does my code go?
|
rbaldwin | Word VBA | 3 | 03-14-2012 02:31 PM |
vbc code
|
rajpeter | Excel Programming | 2 | 09-13-2011 02:29 PM |