hi all im trying to addapt my printing code so it will print my text what ever i have selected it to be in the text editor. here is the code i have at the moment can someone help me please.

Private Sub PrintDocument1_BeginPrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs) Handles mypdoc.BeginPrint
str = CType(Me.ActiveMdiChild, frmSplit).RTB.Text 'If this was a single text editor this line would read (str = mytext.text)
f = CType(Me.ActiveMdiChild, frmSplit).Font
b = New SolidBrush(Me.ActiveMdiChild.ForeColor)
strformat = New StringFormat()
strformat.Trimming = StringTrimming.Word
End Sub