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

Re: How to: delete sections pagebreak? by Doug

Doug
Thu Jun 23 04:08:10 CDT 2005

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
"papou" <cestpasbon@çanonplus44.fr> wrote in message
news:OYBO3I9dFHA.2124@TK2MSFTNGP14.phx.gbl...
> 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
>
>



Re: How to: delete sections pagebreak? by papou

papou
Thu Jun 23 05:59:41 CDT 2005

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
"Doug Robbins" <dkr@REMOVEmvps.org> a écrit dans le message de
news:%23g1GYM9dFHA.2180@TK2MSFTNGP12.phx.gbl...
> 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
> "papou" <cestpasbon@çanonplus44.fr> wrote in message
> news:OYBO3I9dFHA.2124@TK2MSFTNGP14.phx.gbl...
> > 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
> >
> >
>
>