Problem implementing Duplex code

V

Valerie M

I'm having difficulty implementing Jonathan West's code for controlling
printer properties.
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=116

The problem is in the following line:
iRet = OpenPrinter(sPrinterName, hPrinter, pd)

iRet returns 0 indicating I'm unable to access the printer.

I'm assuming this is a rights issue as the IT department on this site
has locked down the printers so users aren't able to mess with the
default properties (although they are able to make temporary
adjustments via the Properties button on Word's Print dialog).

Does anyone have an idea how I can get around this? I'd like to be able
to control the duplex setting, but I'd be happy if I could just find
out if duplex is active (so I can warn users not to send a sheet of
labels).
 
V

Valerie M

Thanks for your response, Jonathan. Unfortunately the client says that
installing the printer drivers locally is not an option.

At the moment I'm providing users with a button on their customised
Print dialog to give them quick access to the printer properties -
using an old WordBasic command:

WordBasic.FilePrintSetup Options:=1

The user then selects or deselects duplexing and the setting is changed
for the duration of the Word session (which is what we want). Assuming
they are all using the same printer driver, I could probably add some
SendKeys commands to set the options automatically (in order to avoid
mishaps when users forget to change the settings between print jobs).

Jonathan's code seems to be changing the overall printer defaults,
rather than the temporary settings that users are able to adjust
manually within Word. Is that correct?

So I guess I have two questions:
1. Is it possible to modify the code to change the temporary settings
rather than the printer defaults?
2. Failing that, is there any way I can check the status of the duplex
settings within Word so I can warn the users that they need to change
the setting before printing labels (I tried using Jonathan's code for
this but it didn't work, presumably because it wasn't a local printer
driver)
 

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

Similar Threads


Top