Article ID: 184899
Article Last Modified on 5/12/2003
APPLIES TO
- Microsoft Visual Basic 6.0 Learning Edition
- Microsoft Visual Basic 6.0 Professional Edition
- Microsoft Visual Basic 6.0 Enterprise Edition
This article was previously published under Q184899
SYMPTOMS
When you use the SelPrint method in Visual Basic, you receive unexpected
results. If you execute an EndDoc method after a SelPrint, you may receive
the following error:
Run-time Error #482:
Printer Error
Additionally, if you are printing information after the SelPrint method
within the same print job, you may find that the information is not
printed.
CAUSE
The SelPrint method of the Rich TextBox control that ships with Visual
Basic 6.0 has an optional second argument. This argument determines whether
the SelPrint method performs the StartDoc and EndDoc printer control
operations, and sends data to the printer using only EndPage and StartPage
operations as required. If you set this second argument to TRUE (or omit
it), the SelPrint method performs the StartDoc and EndDoc operations. If
you set this second argument to FALSE, the SelPrint method does not perform
the StartDoc and EndDoc operations.
RESOLUTION
There are two solutions to this problem:
- If you are not printing any information before or after the SelPrint
method executes, do not use the EndDoc method and either omit the second
argument of SelPrint or set it to True.
- If you want to print additional information after the SelPrint method
executes, set the second argument of SelPrint to False so that SelPrint
does not issue an EndDoc before your print job completes.
STATUS
This behavior is by design.
Additional query words: kbVBp600 kbVBp kbdsd kbDSupport kbPrinting
Keywords: kbprb kbctrl KB184899