![]() |
|
|
|
#1
|
|||
|
|||
|
I think got now.
Sub Test() Dim i As Long, NameOrig As Variant MyList = Array("—", "[ ]{1,}—", "—[ ]{1,}", "[ ]{1,}—[ ]{1,}") Options.DefaultHighlightColorIndex = wdTurquoise With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .Forward = True .Wrap = wdFindContinue .MatchWildcards = True .Replacement.Text = "^32—^32" For i = 0 To UBound(MyList) .Text = MyList(i) .Replacement.Highlight = wdTurquoise .Execute Replace:=wdReplaceAll Next End With End Sub |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Find and change the background color of certain keywords
|
alex100 | Word VBA | 2 | 05-04-2020 11:19 PM |
| Find % change from last month automatically updated | GraemeSS | Excel | 7 | 04-03-2020 02:50 AM |
| Loop through all shapes in all stories not working | Peterson | Word VBA | 5 | 03-04-2018 11:02 AM |
Can a word doc have 2 continuous 'stories' across multiple pages?
|
Cosmo | Word | 1 | 06-19-2014 01:09 PM |
Find and Replace - Variable change
|
Ssendam | Excel | 1 | 07-16-2009 11:44 AM |