Printer Duplex

P

paschoemans

Hello,

I've a problem with my SetPrinterDuplex function use.
(See http://support.microsoft.com/kb/q230743)

I want to print a file with duplex option.
So, I use the function like this:

SetPrinterDuplex PrinterName, 2

Then I print with printout:

Application.PrintOut Background:=False, Copies:=NumberOfCopies (that is a
var declared upper in my code).

And then, I want to go back to no duplex settings with

SetPrinterDuplex PrinterName, 1

The problem is that the document is not printed on both side.
If I remove the last line, it works fine.
So I suppose my problem occurs because the 2nd setprinterduplex switch the
property too quickly. Is it ?

Does someone have a solution ?
 
P

paschoemans

Thanks for your remark

I've already read your article once.
It was very clear and helpfull.

But I use the code for the microsoft technet article on which is based yours
because I need only to change one property. So it was easier to read.
But I use the same system as you describe for the duplex:

1) change the property to use duplex
2) print with background := False (and a number of copy)
3) go back to the previous setting

And the result is that it's printed only one one side.
But I'm sure that the function to switch the property works fine because if
I remove the 3rd line (go back to previous setting), it's printed on duplex.

Do you see my problem ?
It's probably because the print property is turned back too quickly.
Do you have a solution for me ?

Many thanks
 
J

Jonathan West

Dealing with printers is always rather flaky and different printers behave
in different ways.

Try including a few DoEvents commands within your macro after the PrintOut
method and before you set the duplex back single-sided.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
 
P

paschoemans

Now it's working according to the events queue flush.

Many thanks and best regards
 

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