Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2007

Tip: Looking for answers? Try searching our database.

Remove all page break and rearrange

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NEL:Remove all page break and rearrange - 02 Mar 2007 09:38 GMT
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 - 02 Mar 2007 12:03 GMT
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"

NEL:Remove all page break and rearrange - 03 Mar 2007 03:23 GMT
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"

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.