Hi,
if the pagebreaks were inserted by hand or by code
they can be removed.
>based on some criteria.
Very probably.
If a criterion would be your blood pressure
at a given time, it would need some preparations. ;-)
You got to tell us more.

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
Hi,
Thanks for your reply.
Actually the situation is like :
I need to remove all the page break of the whole document.
And then, I will search a keyword like the company name and add a page break
before the company name.
Is it possible?
Thanks
> Dear All,
> I have some hugh word documents. I want to remove all the page breaks of
> the whole document and add the page break based on some criteria.
> Can VBA achieve it?
> Thanks in advance
Helmut Weber - 03 Mar 2007 07:58 GMT
Hi,
like this,
if the pagebreaks are simple manual pagebreaks (^m),
not sectionbreaks (^b) of type new page.
Then it would not be quite that simple.
Sub Macro9AA()
Dim rngDcm As Range
Set rngDcm = ActiveDocument.Range
With rngDcm.Find
.Text = "^m"
.Replacement.Text = ""
.Execute Replace:=wdReplaceAll
.Text = "Company"
.Replacement.Text = "^mCompany"
.Execute Replace:=wdReplaceAll
End With
End Sub

Signature
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"