Results 1 to 3 of 3

Thread: copy rich text

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    13
    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,

  2. #2
    Guest
    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

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    try this also:

    Code:
    Clipboard.SetText rtf1.TextRTF, vbCFRTF
    Clipboard.SetText rtf1.Text, vbCFText
    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 rtf

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width