View Single Post
 
Old 02-18-2013, 04:22 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Hi norgro,

Try:
Code:
Sub Highlight_ER_in_SEVERE()
'Search for "severe". Highlight only the letters "er".
Dim oRng As Range
With ActiveDocument.Range
  With .Find
    .MatchWholeWord = True
    .Text = "severe"
    .Wrap = wdFindStop 'stops at the end of the document
  End With
  While .Find.Execute
    Set oRng = .Duplicate
    With oRng
      .Start = .Start + 3
      .End = .End - 1
      .HighlightColorIndex = wdGreen
    End With
    .Collapse wdCollapseEnd
  Wend
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote