How to print a blank page from Word VBA ?

J

jm.almeras

Hello dear VBA experts,

In a Word macro I need at some point to print a white page, for which I
suppose one needs to send to the printer currently active within Word, some
code like a page feed...) I explain the purpose of my macro at the end of
this
post if your are curious to know why.

I have tried selecting a paragraph mark and printing the current selection,
unfortunately this will printout the eader and footer too, so it does not
match my need.

I suppose it needs to be done with windows printing API

Any advice and/or piece of code will be welcome

All the best to you

Jean-Marie

PS : My macro will printout a word document as a leaflet on any printer, ie
a small leaflet which will be finely composed by taking the final bundle of
sheets of paper and folding it in the middle. It will need 4 goes, the first
go will printout odd pages on the right side of the paper sheets, then I
take the bundle of sheets and put them back into the printer and I print
another set of odd pages still on the right side of the paper (but on the
other side of the sheets), then two more goes will print even page numbers
on the left side of the paper. If you get the idea, you may imagine that
when reaching the last pages of the booklet, sometimes I must leave the
paper blank, but I wish the paper to come out of the printer.
 
J

Jean-Guy Marcil

jm.almeras was telling us:
jm.almeras nous racontait que :
Hello dear VBA experts,

In a Word macro I need at some point to print a white page, for which
I suppose one needs to send to the printer currently active within
Word, some code like a page feed...) I explain the purpose of my
macro at the end of this
post if your are curious to know why.

I have tried selecting a paragraph mark and printing the current
selection, unfortunately this will printout the eader and footer
too, so it does not match my need.

I suppose it needs to be done with windows printing API

Any advice and/or piece of code will be welcome

All the best to you

Jean-Marie

PS : My macro will printout a word document as a leaflet on any
printer, ie a small leaflet which will be finely composed by taking
the final bundle of sheets of paper and folding it in the middle. It
will need 4 goes, the first go will printout odd pages on the right
side of the paper sheets, then I take the bundle of sheets and put
them back into the printer and I print another set of odd pages still
on the right side of the paper (but on the other side of the sheets),
then two more goes will print even page numbers on the left side of
the paper. If you get the idea, you may imagine that when reaching
the last pages of the booklet, sometimes I must leave the paper
blank, but I wish the paper to come out of the printer.

So, sometimes, when you have a leaflet made up of a number of pages that are
not a multiple of 4 you need to have every fourth page blank so that if you
print many copies, the fourth blank page is included in the print out.

Is that right?

If so, why not just include that page in the document itself?
Add a section break "NextPage". Then, go into the headers/footers of this
last section and break the connection to the previous sections, finally,
delete al headers/footers content.

You could have a macro that does that if this is something you need to do
often.

Would that work for your purpose?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

jm.almeras

You are quite right, I had no thought of this, but it is indeed a good
solution
Merci, Bravo !
Jean-Marie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top