View Single Post
 
Old 11-03-2013, 03:57 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try something based on:
Code:
Sub ReplaceList()
Application.ScreenUpdating = False
Dim vFindText As Variant, i As Long
'highlight red words
Options.DefaultHighlightColorIndex = wdRed
vFindText = "England,France"
vFindText = vFindText & ",New Zealand,Zambia"
vFindText = Split(vFindText, ",")
With ActiveDocument.Content.Find
  .ClearFormatting
  .Replacement.ClearFormatting
  .Forward = True
  .Wrap = wdFindContinue
  .MatchWholeWord = True
  .MatchWildcards = False
  .MatchSoundsLike = False
  .MatchAllWordForms = False
  .Format = True
  .MatchCase = True
  .Replacement.Text = "^&"
  .Replacement.Highlight = True
  For i = LBound(vFindText) To UBound(vFindText)
    .Text = vFindText(i)
    .Execute Replace:=wdReplaceAll
  Next i
End With
Application.ScreenUpdating = True
End Sub
PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote