I am trying to print selected text or the entire page if nothing is selected. but for some reason the "SelText" Property is retaining the text and when I set it to "" it clears out the text that was selected previously in the RichTextBox.


here is the code:


Code:
Private Sub Command1_Click()

If Not RTFPrint.SelText = "" Then
    Printer.Print RTFPrint.SelText
    Printer.EndDoc
Else
    Printer.Print RTFPrint.Text
    Printer.EndDoc
End If
RTFPrint.SelText = ""
End Sub