Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Remove spaces (Hard-returns) at top of pages | Microsoft Word Help | |||
Odd page breaks | Microsoft Word Help | |||
multiple page document | Page Layout | |||
Header & Footer not on first page but on subsequent pages | Microsoft Word Help | |||
Insert objects at page breaks | Microsoft Word Help |