I am using vb 6.0 Can anyone tell me if you can copy things from a richtextbox without it coping all the rich text code so that when it is pasted it only pastes the text. If you can give me the code of how to do this.
Thanks,
Printable View
I am using vb 6.0 Can anyone tell me if you can copy things from a richtextbox without it coping all the rich text code so that when it is pasted it only pastes the text. If you can give me the code of how to do this.
Thanks,
I do not quite understnad your question. Do you want to copy text from the RichTextBox and have it pasted in ASCII format? If so, the following example will work. Make a Form with a RichTextBox, TextBox and a CommandButton.
Code:Private Sub Command1_Click()
ClipBoard.SetText(RichTextBox1.Text)
' If you want to copy it in RichTextFormat, you could use
'ClipBoard.SetText(RichTextBox1.TextRTF, vbCFRTF)
End Sub
try this also:
then if the application which uses paste next, dosn't support rtf it will paste normal text, instead of the other weird code. but if it does like microosft word it will paste as rtfCode:Clipboard.SetText rtf1.TextRTF, vbCFRTF
Clipboard.SetText rtf1.Text, vbCFText