Runtime Error 482 Printer Error
I get a “Runtime Error 482 Printer Error” when I try to print to a colour printer I don’t get it when I print to a PDF spooler or another black and white printer.
The colour printer is working, does have paper and I can print to it from other applications.
Any reasons why this is and is there a way I can be sure my application can print to any printer that is attached to the computer?
Re: Runtime Error 482 Printer Error
What do you print? Is there any special Font, unusual margins, paper size, etc?
Re: Runtime Error 482 Printer Error
Anything different about the code you are using for this printer as opposed to the others?
If you go outside your application can you print to the color printer?
Re: Runtime Error 482 Printer Error
I've just done a test trying to send "Hello" to the colour printer using this code and I get the same error. And yep, the printer prints using all other applications.
Note I use this newer printdlg as for some reason the defaut one stalls for 10 seconds before printing. http://support.microsoft.com/kb/322710
vb Code:
Private Sub Form_Load()
Dim printDlg As PrinterDlg
Dim NewPrinterName As String
Dim objPrinter As Printer
Dim strsetting As String
Set printDlg = New PrinterDlg
' Set the starting information for the dialog box based on the current
' printer settings.
printDlg.PrinterName = Printer.DeviceName
printDlg.DriverName = Printer.DriverName
printDlg.Port = Printer.Port
' Set the default PaperBin so that a valid value is returned even
' in the Cancel case.
printDlg.PaperBin = Printer.PaperBin
If Not printDlg.ShowPrinter(Me.hWnd) Then
Debug.Print "Cancel Selected"
Exit Sub
End If
' Locate the printer that the user selected in the Printers collection.
NewPrinterName = UCase$(printDlg.PrinterName)
If Printer.DeviceName <> NewPrinterName Then
For Each objPrinter In Printers
If UCase$(objPrinter.DeviceName) = NewPrinterName Then
Set Printer = objPrinter
End If
Next
End If
Printer.Print "hello"
End Sub
Re: Runtime Error 482 Printer Error
Since you're not using any standard functionality I wouldn't know what to suggest.
I personally try to stay away from any third party controls or dll regardless who's the vendor unless it's something absolutely necessary.
Sorry for not being helpfull.
Re: Runtime Error 482 Printer Error
I have a strange problem with using the commondialog.showprinter. It stalls for an annoyingly long time before the document appears in the print queue.
Roughly 10 seconds. I'm using the Microsoft Common Dialog Control 6.0(SP6) and it does it even using this code. Is there anything that I can do?
vb Code:
Option Explicit
Private Sub Form_Load()
CommonDialog1.ShowPrinter
Printer.Print "Hello"
Printer.EndDoc
End Sub