-
Hi -- I am working on a VB program that prints out a form. Before the print, I want to change the "PaperBin" property of the printer. I only have one printer set up (it's a network printer set as the default), but I explicitly set it in my code anyway, and have a message box showing that it's really the correct printer. Yet, when I try to change the PaperBin property, I get error "383 -- property read only."
Any ideas?
Thanks!
Here's the snippet of my code:
Dim CheckPrinter As Printer
Set CheckPrinter = Printers(0)
MsgBox "CheckPrinter(0) = " & CheckPrinter.DeviceName
CheckPrinter.PaperBin = vbPRBNMiddle
-
I've received some advice on other message boards, but it's still getting me nowhere. One post said not to use the Set statement for the printer, but MSDN says that I must use that in order to have write-access. In any case, if I try this:
Printers(0).PaperBin = 7
I still get the "383 -- read-only" error.
Another post said that I might need a new printer driver. I'm a little nervous about doing this -- I don't want to mess up other printing.
Does anyone have any more ideas?
Thanks
-
Someone on the NoWonder message board helped me figure it out -- I should have been saying:
Set Printer = Printers(0)
Printer.PaperBin = vbPRBNAuto
instead of declaring "CheckPrinter" & setting it to "Printers(0)."
That part's working now, but when my code finishes setting the printer properties & tries to print the form, I get this error:
"486 -- can't print form image to this type of printer".
I get this error even if I set the Paperbin property to the default (if I don't set it to anything, the form prints fine).
Here is my code -- any more ideas?
Thanks!
Set Printer = Printers(0)
Printer.PaperBin = vbPRBNAuto ' default
Me.PrintForm
Unload Me