hi, I have code that produces various documents.

Now, in the main, the documents are printed on a duplex printer and so
the document contains extra page breaks to ensure that certain pages
dont print on the reverse of the previous page (ie it inserts 2 page
breaks instead of 1)

However, sometimes i'll be printing on a single sided printer and as
such i end up getting a load of 'blank' pages (apart from the header
and footer).

Is tehre a way i can loop thru all pages in the doc and if there is
nothing in the main body of a page then it removes the page?

Thanks.

RE: removong 'blank' pages by JeanGuyMarcil

JeanGuyMarcil
Thu May 08 12:23:05 PDT 2008

"macroapa" wrote:

> hi, I have code that produces various documents.
>
> Now, in the main, the documents are printed on a duplex printer and so
> the document contains extra page breaks to ensure that certain pages
> dont print on the reverse of the previous page (ie it inserts 2 page
> breaks instead of 1)
>
> However, sometimes i'll be printing on a single sided printer and as
> such i end up getting a load of 'blank' pages (apart from the header
> and footer).
>
> Is tehre a way i can loop thru all pages in the doc and if there is
> nothing in the main body of a page then it removes the page?
>

Personally, I would not work like this... Too complicated and it makes for
code that is difficult to handle.

When creating documents, instead of inserting 2 section breaks, I would
insert an Odd Page section break.This way Word will automatically insert the
blank pages (that is their purpose).

In the second case, I would do a search and change all sections that are
headed by an Odd section break to a Next Page section page.

Much cleaner, easier and shorter.