print11

 

Print RichTextBox


Print RichTextBox

The following code will print RichTextBox formatted text.
It won't print any pictures that found inside the RichTextBox.

Preparations

Add 1 Command Button and 1 RichTextBox to your form (From VB menu choose
Project -> Components..., mark the "Microsoft Rich TextBox Control X.0"
check box,
and press OK.


Form Code


Private Sub Command1_Click()
Call RichTextBox1.SelPrint(Printer.hdc)
End Sub