I have a procedure that is communicating with the printer so generally i want to trap all priter errors out of paper for exable or a printer buffer overflow. so i put in this
On Error GoTo CheckError
right after my dim statment and then when errors occured it would halt the program and bring up the default error window display end,debug,help options commonly seen when debuging a vb6 app. what i want it to do is to goto the CheckError code which i put at the bottom of ther procedure before the end sub statement which looks like this.
CheckError: 'Branch here if error occurs
Const cPrinterError = 482
Const cPrinterDriverNotSupported = 483
Const cPrinterConnectionFailed = 484
Const cPrinterCantPrint = 486
If Err.Number = cPrinterError Then
MsgBox "bleh", vbOKOnly, "bleh"
ElseIf Err.Number = cPrinterDriverNotSupported Then
MsgBox "bleh", vbOKOnly, "bleh"
Resume
ElseIf Err.Number = cPrinterConnectionFailed Then
MsgBox "bleh", vbOKOnly, "bleh"
Resume
ElseIf Err.Number = cPrinterCantPrint Then
MsgBox "bleh", vbOKOnly, "bleh"
Resume
End If
even if right after i write on error goto CheckError I do an err.raise(482) (General Printer Error) it does not goto the checkerror routine it just displays the default vb6 error debuging window with the end,debug,help i mentioned before. every help file i have read says todo it this way and i have not enabled error handling anywhere else in my application. Any questions/comments/ideas are very apperciated thanks.
On Error GoTo CheckError
right after my dim statment and then when errors occured it would halt the program and bring up the default error window display end,debug,help options commonly seen when debuging a vb6 app. what i want it to do is to goto the CheckError code which i put at the bottom of ther procedure before the end sub statement which looks like this.
CheckError: 'Branch here if error occurs
Const cPrinterError = 482
Const cPrinterDriverNotSupported = 483
Const cPrinterConnectionFailed = 484
Const cPrinterCantPrint = 486
If Err.Number = cPrinterError Then
MsgBox "bleh", vbOKOnly, "bleh"
ElseIf Err.Number = cPrinterDriverNotSupported Then
MsgBox "bleh", vbOKOnly, "bleh"
Resume
ElseIf Err.Number = cPrinterConnectionFailed Then
MsgBox "bleh", vbOKOnly, "bleh"
Resume
ElseIf Err.Number = cPrinterCantPrint Then
MsgBox "bleh", vbOKOnly, "bleh"
Resume
End If
even if right after i write on error goto CheckError I do an err.raise(482) (General Printer Error) it does not goto the checkerror routine it just displays the default vb6 error debuging window with the end,debug,help i mentioned before. every help file i have read says todo it this way and i have not enabled error handling anywhere else in my application. Any questions/comments/ideas are very apperciated thanks.