How to: delete sections pagebreak?

P

papou

Hi all
I am trying to automate deletion of sections pagebreaks in a Word document.
I have tried this:
With ActiveDocument
..Sections
For i = 1 To .Count
..Item(i).Range.Delete
Next i
End With

but to no avail since this will delete the entire pages of my merged
document where I only want to delete the pagebreaks.


TIA
Cordially
Pascal
 
D

Doug Robbins

Use Edit>Replace. But probably not Replace All. Be mindful of what it may
do the headers and footers.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
P

papou

Hello Doug
Thank you for your answer.
I have tried this method but it seems that the first section pagebreak won't
delete.
Any solution?

Here's my code:
Selection.WholeStory
With Selection.Find
..Text = "^b"
..Replacement.Text = ""
..Forward = True
..Wrap = wdFindContinue
..Execute Replace:=wdReplaceAll
End With

TIA
Cordially
Pascal
 

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