O
Olivier
Hi
How can I append RTF formated text in a RichTextBox ?
Thanks
Olivier
How can I append RTF formated text in a RichTextBox ?
Thanks
Olivier
Public Sub copyText()
Dim rtbTmp As New RichTextBox ' Temporary Rich Text Box
Dim datobj As New System.Windows.Forms.DataObject
' Copy RichTextBox1 into rtbTmp
rtbTmp.Rtf = RichTextBox1.Rtf
' Add Line Feed (if you want one)
rtbTmp.AppendText(vbCrLf)
' Copy RichTextBox2 to the Clipboard
datobj.SetData(DataFormats.Rtf, RichTextBox2.Rtf)
Clipboard.SetDataObject(datobj)
' Paste RichTextBox2's copied text to the end of Temporary Rich Text Box
rtbTmp.SelectionStart = rtbTmp.TextLength
rtbTmp.Paste()
' Copy combined contents of Temporary Rich Text Box to the clipboard
datobj.SetData(DataFormats.Rtf, rtbTmp.Rtf)
Clipboard.SetDataObject(datobj)
End Sub