Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 09-18-2015, 03:20 PM
macropod's Avatar
macropod macropod is offline Macro Loop Help Windows 7 64bit Macro Loop Help 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

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
The OP could also have achieved the desired pagination just by changing the page margins...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
macro, vba, word macro



Similar Threads
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
Macro Loop Help Loop Macro to Edit Date damaniam Word VBA 7 02-21-2014 07:12 AM
Macro Loop Help Loop Macro to Edit Date damaniam Word VBA 11 12-05-2013 08:28 AM
Macro Loop Help Macro to loop in Word Yamaha Rider Word VBA 2 02-07-2012 05:33 PM
Macro Loop Help Macro to loop in subfolders, change links, export xml data Catalin.B Excel Programming 2 09-08-2011 11:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft