![]() |
|
#1
|
|||
|
|||
|
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
is it possible to get this macro to work for Outlook 2010 or I should say the same concept? Last edited by flatop; 07-17-2013 at 12:30 PM. Reason: Clarification |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Find and highlight multiple words in MS Word document
|
AtaLoss | Word VBA | 37 | 09-22-2021 12:04 PM |
Help with finding multiple keywords in a single document then highlight
|
navyguy | Word | 2 | 01-03-2014 12:48 PM |
Highlight and then replace multiple words
|
redhin | Word VBA | 5 | 03-05-2013 05:42 AM |
Find and highlight all words ending in -ly
|
RBLampert | Word VBA | 13 | 10-23-2012 04:45 PM |
| find - reading highlight - highlight all / highlight doesn't stick when saved | bobk544 | Word | 3 | 04-15-2009 03:31 PM |