![]() |
#2
|
||||
|
||||
![]()
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] |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
lucnijs | Excel | 6 | 03-26-2012 09:29 AM |
![]() |
14spar15 | Word | 1 | 11-13-2011 11:17 PM |
Highlight Document | Jodib | PowerPoint | 1 | 10-14-2011 07:25 AM |
Junk characters (box-like characters) in Word file | Sashikala | Word | 1 | 04-20-2010 02:03 PM |
find - reading highlight - highlight all / highlight doesn't stick when saved | bobk544 | Word | 3 | 04-15-2009 03:31 PM |