Solved

Printer error 482

Posted on 1998-09-27
4
1,572 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

838 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