![]() |
#2
|
||||
|
||||
![]()
You could do that with a macro like:
Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "<[0-9]{1,2} [JFMASONDanuryebchpilgstmov]{3,9} [12][0-9]{3}>" .Replacement.Text = "" .Forward = True .Format = False .Wrap = wdFindStop .MatchWildcards = True .Execute End With Do While .Find.Found = True If .Characters.First.Information(wdActiveEndAdjustedPageNumber) _ <> .Characters.Last.Information(wdActiveEndAdjustedPageNumber) Then .HighlightColorIndex = wdBrightGreen End If .Collapse wdCollapseEnd .Find.Execute Loop End With Application.ScreenUpdating = True End Sub Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range.Find .ClearFormatting .Replacement.ClearFormatting .Text = "<([0-9]{1,2}) ([JFMASONDanuryebchpilgstmov]{3,9}) ([12][0-9]{3})>" .Replacement.Text = "\1^s\2^s\3" .Forward = True .Format = False .Wrap = wdFindContinue .MatchWildcards = True .Execute Replace:=wdReplaceAll End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
date |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Require assistance in writing code to login to webmail account. | saurabhlotankar | Excel Programming | 4 | 05-21-2015 10:47 AM |
Assistance with Word 2010 If formula | ciresuark | Word | 1 | 03-09-2015 12:57 PM |
![]() |
mpdsal | Word VBA | 8 | 09-11-2014 03:55 PM |
Code to add dates | terricritch | Excel Programming | 10 | 11-08-2011 09:51 AM |
find - reading highlight - highlight all / highlight doesn't stick when saved | bobk544 | Word | 3 | 04-15-2009 03:31 PM |