Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2006

Tip: Looking for answers? Try searching our database.

Problem implementing Duplex code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Valerie M - 23 Mar 2006 02:55 GMT
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).
Jonathan West - 23 Mar 2006 10:16 GMT
Hi Valerie,

Have you installed a local copy of the printer driver? The code won't work
without that.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

> I'm having difficulty implementing Jonathan West's code for controlling
> printer properties.
[quoted text clipped - 14 lines]
> out if duplex is active (so I can warn users not to send a sheet of
> labels).
Valerie M - 28 Mar 2006 02:54 GMT
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)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.