Microsoft KB Archive/185887

= DOC: Incomplete Documentation for SelPrint Method =

Article ID: 185887

Article Last Modified on 5/13/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 Q185887



SUMMARY
The SelPrint Function of the RichTextBox Control now has an optional second parameter that is not documented in the Online Help. The information below can also be found in the Readmevb.htm on the Visual Basic 6.0 CD.



RichTextBox Control: SelPrint Method Has New Argument
The SelPrint method now features a second, optional argument. The syntax and part descriptions are shown below:

Syntax object.SelPrint(lHDC As Long, [vStartDoc])

The SelPrint method syntax has these parts: Part         Description --- object       An object expression that evaluates to a RichTextbox control.

lHDC         Long. The device context of the device you plan to use to             print the contents of the control.

vStartDoc    Boolean. Specifies the behavior of the control regarding startdoc and enddoc printer control operations, as shown in             settings.

Settings

The settings for vStartDoc are:

Constant       Value           Description - True           -1              (Default) The control retains its original behavior and sends startdoc and enddoc commands to the printer.

False           0              The control does not send startdoc and Enddoc commands, but sends only startpage and endpage commands to the printer.

Remarks:

The argument was added to remedy situations when printers do not print with the default behavior. When the SelPrint method is invoked, both Visual Basic and the RichTextBox control send startdoc and enddoc commands to the printer resulting in a nested pair of startdoc/enddoc commands. Some printers respond only to the first pair of commands and thereby become disabled when the RichTextbox control sends the second pair. In that case, setting the vStartDoc argument to False prevents the second pair of commands from being sent.

