Access 2002 channging the printer paperbin via VBA-code

S

Synnøve Engel

My problem is: I can't change the printer paperbin with
Application.Printer.Paperbin.
I'm using a LEXMARK T630, which paperbin numers are all > 255. Some reports
have to printed from the upper tray, some from the lower tray.
Now all reports are printed from the default papertray.

I read the numbers using the API DeviceCapabilities. That works fine.
The programm must be able to choose any networkprinter, read the bin numbers
und change the paperbin.
Is there a way to solve this problem?

Thanks,
Synnoeve
 
S

Sean Gifford

I have also encountered this issue. Using the code presented in the previous
reply, and in other sources, I was able to find an enumerated list containing
all of the Trays for my printer, and their respective ID's. However, I have
been unable to find any resources indicated how to actually print to those
Tray IDs when they are enumerated greater than 255.

Below is a truncated list of the Trays for the printer I am interested in
printing on:
15 Automatically Select
257 Printer auto select
259 Tray 1
260 Tray 2
261 Tray 3 (500-Sheet)
258 Manual Feed (Tray 1)
1273 Unspecified
1272 Plain
etc. etc.
1 Default tray

In this instance, I wish to print to Tray 2 (260).

As part of the Printers Object in VBA, the standard acPRBNLower,
acPRBNUpper, acPRBNMiddle etc. obviously do not work as they are associated
with completely different numbers, as seen in
:http://msdn.microsoft.com/en-us/library/bb225948.aspx

Attempting to directly use the value 260, as:

Access.Printer.PaperBin = 260

Does not work, and I receive Run-time Error '5': Invalid procedure call or
argument

Any ideas? For now I am requiring the users of my database to select the
appropriate tray through the printer options window, however this is not the
optimal solution, as I would like this to occur automatically.
 
S

Sean Gifford

Well I have come up with a simple, however flimsy work-around for this for now.

I merely went into the report that I am generating, and changed it's page
setup to print to tray 2. As I have two of the same model printers in the
office, it is working out so far. Obviously this only works for printing the
entire report, and only in this small scenario.
 

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