Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
bsklusky
 
Posts: n/a
Default How do I remove consecutive multiple page breaks?

I'm logging a report to a .doc from another application, which inserts
extraneous page breaks. Is there a way to set up a macro to remove
extraneous, consecutive page breaks, while leaving only 1 page break?

Thanks,
Barry Klusky
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman
 
Posts: n/a
Default How do I remove consecutive multiple page breaks?

bsklusky wrote:
I'm logging a report to a .doc from another application, which inserts
extraneous page breaks. Is there a way to set up a macro to remove
extraneous, consecutive page breaks, while leaving only 1 page break?

Thanks,
Barry Klusky


The simple manual, non-macro procedu
The code for a manual page break in the Find/Replace dialog is ^m . Open the
dialog, enter ^m^m in the Find What box and only one ^m in the Replace
With box, and click the Replace All button. Keep clicking Replace All until
it says there were 0 replacements.

As a macro (slightly different approach, using wildcards):
Sub RemoveMultiplePageBreaks()
Dim oRg As Range
Set oRg = ActiveDocument.Range
With oRg.Find
.ClearFormatting
.Text = "([^12])[^12]{1,}"
.Replacement.Text = "\1"
.Format = False
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End Sub

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove spaces (Hard-returns) at top of pages Ant(antonfh_at_gmail_dot_com) Microsoft Word Help 14 March 30th 06 03:47 PM
Odd page breaks PierceM Microsoft Word Help 1 February 18th 06 04:38 AM
multiple page document George Applegate Page Layout 2 July 1st 05 09:27 PM
Header & Footer not on first page but on subsequent pages KM1 Microsoft Word Help 14 June 13th 05 12:36 AM
Insert objects at page breaks DRS - Jonathan Microsoft Word Help 4 November 29th 04 07:16 PM


All times are GMT +1. The time now is 09:45 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"