1. Pages don't exist as such in the Word object model: they are artifacts of
the formatting, not containers.
2. A page cannot be completely blank (other than pages inserted at print-out
as a consequence of next even/odd page section breaks). There must be at
least one paragraph for the page to exist at all.
That said, yes it would be possible to find empty paragraphs that exist in
isolation on a page of their own, and to delete them. Is this something you
need to do often? Can't see that using VBA is going to help you much here: I
think you'd have to visually examine the document anyway to check the
consequences of the deletion. In which case, you might as well do the whole
exercise manually.
- Show quoted text -
I cobbled together something once to iterate through the pages of a
document and save each page out as a new file.
One thing I would think you must determine before you delete is: why
is that page blank? Was the document composed on a computer with a
different printer driver than yours, reformatting the pages and
putting blanks where there weren't before? Are there some styles or
other formattings keeping paragraphs from flowing smoothly? Did some
kind of file conversion leave a bit of junk on the page that's messing
with the pagination?
Maybe if you can tell us what you;re dealing with, we can take a
better shot. Otherwise, turn on Show All and look at each page and
decide if you want to delete it or not.
And when you do try something, please try it on a COPY of your
important work. Nothing bites more than making a mistake in a macro
and you can't catch it to stop it before it hits ActiveDocument.Save
at the end!
Ed