Access 2003 Printer Settings

C

Cheval

I'm trying to set the printer, paper size and source tray via vba code.

I can set the Printer using the following code


Dim p As Printer
For Each p In Application.Printers
If (StrComp(sPrinter, p.DeviceName, vbTextCompare) = 0) Then
Application.Printer = p
SetPrinter = True
Exit For
End If
Next p

Though, when I set the PaperBin to anything, no matter which printer I have,
it sets it to the first tray only. Should the command
"application.Printer.PaperBin = acPRBNManual" actually work?

I've also used the Windows API's to get the printers trays and tray ID's,
but apparently Access 2003 SP1 can't set a tray ID to anything above 256. eg.
"application.printer.paperbin = 257" equals an error.

So does anyone know how, via code, can I set the printer, tray and size?
 

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