View Single Post
 
Old 08-01-2020, 11:04 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Running my macro as part of the mailmerge would require no more than:
Code:
Sub MailMergeToDoc()
Application.ScreenUpdating = False
ActiveDocument.Mailmerge.Execute
ActiveDocument.Range.Find.Execute FindText:="[0-9]{12}([0-9]{4})", ReplaceWith:="\1", MatchWildcards:=True, Replace:=wdReplaceAll
Application.ScreenUpdating = True
End Sub
Execution would then be via Mailings>Finish & Merge>Edit Individual Documents, the same as with any regular merge. Regardless, a macro really isn't needed...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote