?
Solved

copy a RichTextBox to clipboard

Posted on 2003-03-01
3
Medium Priority
?
972 Views
Last Modified: 2012-05-04
I have a copy to clipboard button on my form like this:

    Clipboard.Clear
    Clipboard.SetText RichTextBox.TextRTF

When I paste inside the box it's great, when I do it on winword it's this:

{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Times New Roman;}}
\viewkind4\uc1\pard\fi-287\li287\lang1033\f0\fs24 csdac sdjajcsdan cjks\b dan ckjsd\b0 anc kjdasnckjsdac s
\par }

Anyone can Help?
0
Comment
Question by:magb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
jayeshshah earned 108 total points
ID: 8048377
Use the below code in your program

Clipboard.Clear
Clipboard.SetText RichTextBox1.TextRTF, vbCFRTF


K'Regards

Jayesh
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 8048390
need to set the clipboard datatype flag:

Clipboard.SetText RichTextBox.TextRTF, vbCFRTF
0
 

Author Comment

by:magb
ID: 8048717
Thanks, It saved my life!!!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question