removing Page Breaks with VBA

B

Bob Slattery

Thanks In Advance,

I would like to remove all Page Breaks in a Document using VBA.

Any assistance would be appreciated.

Sincerely,
Bob
 
D

Dave Lett

Hi Bob,

You can use something like the following:

With Selection
.HomeKey Unit:=wdStory
With .Find
.ClearFormatting
.Text = "^m" ' manual page break
With .Replacement
.ClearFormatting
.Text = ""
End With
.Execute Replace:=wdReplaceAll
End With
End With

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top