![]() |
|
#1
|
||||
|
||||
![]()
Hi Andrew,
As per my last post, the lot could be done with a single wildcard Find/Replace. Here's the macro version: Code:
Sub CleanupPayslips() With ActiveDocument.Content.Find .ClearFormatting .Replacement.ClearFormatting .Text = "[^13 ]{7,}(<[0-9]{7}>)" .Replacement.Text = "^p^12 \1" .Forward = True .Wrap = wdFindContinue .Format = False .MatchWildcards = True .Execute Replace:=wdReplaceAll End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Tags |
macro, vba, word macro |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to loop through all cells in a table produced by a mail merge | elh52 | Word VBA | 4 | 08-31-2014 10:50 PM |
![]() |
damaniam | Word VBA | 7 | 02-21-2014 07:12 AM |
![]() |
damaniam | Word VBA | 11 | 12-05-2013 08:28 AM |
![]() |
Yamaha Rider | Word VBA | 2 | 02-07-2012 05:33 PM |
![]() |
Catalin.B | Excel Programming | 2 | 09-08-2011 11:37 PM |