PrintPreview1.PrintRichTextBox RichTextBox1
Private Sub Command1_Click()
' show the Print Preview dialog
PrintPreview1.ShowPreview
End Sub
Private Sub PrintPreview1_PrepareReport(Cancel As Boolean)
' the following is the only line needed to print the RichTextBox control
PrintPreview1.PrintRichTextBox RichTextBox1
End Sub
Private Sub Form_Load()
RichTextBox1.LoadFile ([RTB file path])
End Sub
You also will need to add this code in a module (or in the form). This is to replace the VB6 original printer object with a new one:
Public Property Get Printer() As Printer
Set Printer = PrinterReplacement
End Property
Public Property Set Printer(nPrinter As Printer)
Set PrinterReplacement = nPrinter
End Property