![]() |
|
#2
|
||||
|
||||
|
Hi AtaLoss,
Try something based on: Code:
Sub HiLightList()
Application.ScreenUpdating = False
Dim StrFnd As String, Rng As Range, i As Long
StrFnd = "dog,cat,pig,horse,man"
For i = 0 To UBound(Split(StrFnd, ","))
Set Rng = ActiveDocument.Range
With Rng.Find
.ClearFormatting
.Text = Split(StrFnd, ",")(i)
.Replacement.ClearFormatting
.Replacement.Highlight = True
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = True
.Execute Replace:=wdReplaceAll
End With
Next
Set Rng = Nothing
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Tags |
| find, highlight, multiple keywords |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Lost Word Document and cant find it!!! I saved it but it ISNT there!!
|
APAV | Word | 9 | 10-09-2017 01:17 PM |
| Highlight text and find next instance | DrDOS | Word | 0 | 11-15-2010 04:02 PM |
| Lock words in a document, but allow for input within the document | tlinde | Word | 1 | 02-09-2010 09:07 PM |
| FInd recurring words in Word 2003 | NJ007 | Word | 4 | 01-25-2010 03:11 PM |
| find - reading highlight - highlight all / highlight doesn't stick when saved | bobk544 | Word | 3 | 04-15-2009 03:31 PM |