![]() |
#2
|
||||
|
||||
![]()
You could use code like:
Code:
Sub HighlightTargetsN() Dim Rng As Range, i As Long, TargetList TargetList = Array("MMN") ' put list of terms to find here For i = 0 To UBound(TargetList) Set Rng = ActiveDocument.Range With Rng With .Find .Text = TargetList(i) .Format = True .MatchCase = True .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Forward = True .Wrap = wdFindStop .Execute End With Do While .Find.Found .HighlightColorIndex = wdBrightGreen With .Font .Bold = True .ColorIndex = wdRed .Underline = wdUnderlineThick .UnderlineColor = wdRed .Name = "TW Cen MT" .Size = 14 End With If .Information(wdWithInTable) = True Then .Cells(1).Shading.BackgroundPatternColorIndex = wdYellow End If .Collapse wdCollapseEnd .Find.Execute Loop End With Next End Sub For a different way of handling this, which uses the mailmerge functionality instead of post-processing via a macro, see: http://answers.microsoft.com/en-us/o...7-86553a7f8188
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
viuf | PowerPoint | 13 | 02-19-2012 10:34 AM |
![]() |
skoz55 | Excel | 1 | 11-09-2011 09:00 AM |
![]() |
pakistanray | Word Tables | 2 | 10-31-2011 08:07 AM |
Formatting Cells for Currency and Accounting | Sparetyme | Excel | 1 | 07-11-2010 01:26 PM |
![]() |
StarWeaver | Excel | 1 | 03-02-2010 01:41 PM |