PRB: SelPrint Method Issues an EndDoc When Printing (184899)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
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.
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbCtrl kbprb KB184899 |
---|
|