Solved

Printer error 482

Posted on 1998-09-27
4
1,560 Views
Last Modified: 2010-10-29

Hi ,

I've got problems with HP printers...series 400, 500, 600 and 700.
Every time somebody with that kind of printer clicks the 'Print' command
in my program they get a runtime 482.

Unlike the descriptions in 'Help' my guess is that error 482 is a VB message
reporting a bad error code from the printer driver.
How can I trap this error? Can I bypass it an still be able to print?

There are no problems whatsoever with any other printers, but it's absolute
unacceptable my program can't be used by people who own a HP printer...


Ok, this is my print code:

Private Sub cmdPrintSelected_Click()

CommonDialog1.CancelError = True

'errorhandling
On Error GoTo ERRORHANDLER

'give the user a chance to halt the printjob
Dim msg As String
Dim X As Integer
msg = "You're about to print a full page sample of every font you selected. Continue?"
X = MsgBox(msg, 33, "Info")
If X = 2 Then    'do nothing
    Else
   
    'go ahead...
    CommonDialog1.DialogTitle = "Select a printer"
    CommonDialog1.Flags = &H100&
    CommonDialog1.ShowPrinter
   
    Me.Refresh
   
    '...and print
    Dim numitm
    Dim i As Integer
    numitm = listfonts.ListCount
    For i = 0 To numitm - 1
        If listfonts.Selected(i) Then
       
        'create left margin
        Printer.ScaleLeft = -500
        Printer.CurrentX = 0
       
        Printer.Print ""
        Printer.Print ""
        Printer.Font.Name = "Arial"
        Printer.Font.Size = 14
        Printer.Font.Bold = True
        Printer.Font.Italic = False
        Printer.Font.Underline = False
        Printer.Print "Sample of "; listfonts.List(i)
        Printer.Print ""
        Printer.Font.Size = 12
        Printer.Font.Italic = True
        Printer.Print "Size"
        Printer.Font.Name = listfonts.List(i)
        Printer.Font.Size = 6
        Printer.Font.Bold = False
        Printer.Font.Italic = False
        Printer.Print "6-point type, quite small, but readable for most people."
        Printer.Font.Size = 10
        Printer.Print "10-point type, often used for body text."
        Printer.Font.Size = 12
        Printer.Print "12-point type, easy-to-read-size."
        Printer.Font.Size = 14
        Printer.Print "14-point type, ideal for subheads."
        Printer.Font.Size = 18
        Printer.Print "18-point type is for emphasis."
        Printer.Font.Size = 24
        Printer.Print "24-point type makes headlines."
        Printer.Font.Size = 36
        Printer.Print "36-point type: impact."
        Printer.Font.Size = 60
        Printer.Print "60-point type!"
        Printer.Font.Name = "Arial"
        Printer.Font.Size = 12
        Printer.Font.Italic = True
        Printer.Font.Bold = True
        Printer.Print "Style"
        Printer.Font.Name = listfonts.List(i)
        Printer.Font.Bold = False
        Printer.Font.Italic = False
        Printer.Print "This is a normal weight type, suitable for most purposes."
        Printer.Font.Bold = True
        Printer.Print "This is a boldfaced type, ideal for emphasis or headings."
        Printer.Font.Bold = False
        Printer.Font.Italic = True
        Printer.Print "This is an italic (or oblique) type, used for emphasis."
        Printer.Font.Bold = True
        Printer.Print "This is a bold, italic type, combining both emphasis techniques."
        Printer.Font.Bold = False
        Printer.Font.Italic = False
        Printer.Font.Underline = True
        Printer.Print "This is a normal, underlined type."
        Printer.Font.Underline = False
        Printer.Print ""
        Printer.Font.Name = "Arial"
        Printer.Font.Size = 12
        Printer.Font.Italic = True
        Printer.Font.Bold = True
        Printer.Print "Characters"
        Printer.Font.Name = listfonts.List(i)
        Printer.Font.Size = 14
        Printer.Font.Bold = False
        Printer.Font.Italic = False
        Printer.Print "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        Printer.Print "abcdefghijklmnopqrstuvwxyz"
        Dim char As String
        char = "²&é(§è!çà)-^$ùµ<,;:=³1234567890°_¨*%£>?./+|@#^{}[]´`\~"
        Printer.Print char
        Printer.EndDoc  'that's all
       
        End If
    Next

End If

Exit Sub
 
ERRORHANDLER:
Select Case Err.Number
    Case 32755  'cancel error
    'do nothing
    Case Else   'anything else
    MsgBox "An Error was generated:" & vbCrLf & "Description: Error" & Str(Err.Number) & " - " & Err.Description & vbCrLf & vbCrLf & "Please inform the author with the error description above.", , "Error", Err.HelpFile, Err.HelpContext
End Select

End Sub


Thank you,
regards.

0
Comment
Question by:dvbasic
4 Comments
 
LVL 1

Expert Comment

by:kacklehorn
ID: 1436851
What version of VB? What line of Code do you get the error on?
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1436852
Error 482 is generic "printer error".  when does this pop up? What is status of printer? Does ANYTHING print? Have you single stepped thru this code?

Couple of general comments. Move the DIM CHAR out of the loop so it only runs once. Minimum font size is *8*, windows/VB has trouble rendering below 8 so that could be cause if program is stopping on or about that line. Put var name on Next (I know is not required but is cleaner)

I've found certain driver errors with the hp printer drivers, not relating to this problem, but with them rendering open circles and boxes as filled. Don't know it it's related or not.

M
0
 

Author Comment

by:dvbasic
ID: 1436853
Combining both answers:

I'm using VB5 (bought VB6 just now, not installed yet)

I' can't reproduce the error at my home. The errors were reported to me.
I can of coarse reproduce the error by a err.raise in VB, but I wouldn't know where, and how to still get the printing done...

I've got two descriptions of when the error occurs:
In one case, the print dialog comes up, and after setting how many copies and the print range, this user got no response from his printer (nothing happened).
Ater closing the program and open it again, the printer error 482 message came up.

In THAT code (at loading time) I merely do a :

For i = 0 To Printer.FontCount - 1      'get all printerfonts
    teller = i + 1
    formstart.lblCount = teller
    formstart.lblCount.Refresh
    listfonts.AddItem Printer.Fonts(i)  'put each font into list box
Next i

In another case, the runtime occured right after clicking the OK button in the Print Dialog.
(Print dialog dissapears, runtime message pops up).

Hope this helps...



0
 
LVL 3

Accepted Solution

by:
fguerreiro_inix earned 200 total points
ID: 1436854
Bypass the error.

If error is 482 and the printer is one of that kind, bypass it.
(but only in these conditions)

Hope this helps
Regards
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question