![]() |
#2
|
||||
|
||||
![]()
Hi norgro,
You can't select discontiguous ranges with a macro, so your Find/Replace would have to use something like: Code:
Sub Demo() With ActiveDocument.Content.Find .ClearFormatting .Text = Selection.Text With .Replacement .ClearFormatting .Text = "^&" .Highlight = True End With .Forward = True .Wrap = wdFindContinue .Format = True .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute Replace:=wdReplaceAll End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
AtaLoss | Word VBA | 37 | 09-22-2021 12:04 PM |
![]() |
cnyoon2 | Word | 1 | 08-04-2015 08:16 AM |
![]() |
Arbie | Word | 1 | 03-31-2012 05:22 AM |
Highlight un-identifiable | wolfer | Word VBA | 0 | 08-24-2011 06:37 AM |
find - reading highlight - highlight all / highlight doesn't stick when saved | bobk544 | Word | 3 | 04-15-2009 03:31 PM |