Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

copy a RichTextBox to clipboard

Posted on 2003-03-01
3
Medium Priority
?
1,005 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
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

572 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