473,761 Members | 7,351 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy and Pasting RTF to non RTF supported program

I've got an application that I can copy some text out of the
RichTextBox control. I would like to keep the formatting so I'm able
to copy it to the Clipboard with RTF formatting. I have no trouble
pasting the formatted text into wordpad (which supports RTF formatting)
but it won't paste into notepad (no RTF support). I know that if I
copy something in wordpad with RTF formatting and then paste it into
notepad the text will paste. What am I missing that will let me paste
RTF formatted text into an application that doesn't support RTF
formatting?

Here's the code I have to copy:
Clipboard.SetTe xt(rtxtOutput.S electedRtf,
TextDataFormat. Rtf);

I've also tried
String spareData = rtxtOutput.Sele ctedRtf;

DataObject newData = new DataObject(Data Formats.Rtf,
spareData);

Clipboard.SetDa taObject(newDat a, true);
But neither will allow me to paste RTF formatted text into a non-RTF
supported application.

Anyone able to help me?

Jan 26 '07 #1
1 3794
On Fri, 26 Jan 2007 11:47:56 -0800, Grant Smith <gr********@gma il.com>
wrote:
[...] I know that if I
copy something in wordpad with RTF formatting and then paste it into
notepad the text will paste. What am I missing that will let me paste
RTF formatted text into an application that doesn't support RTF
formatting?
Typically, the solution to this is that you have to copy both RTF and
plain text data to the clipboard. Generally speaking, you put each data
format suitable for the data being copied on the clipboard. Then
applications pasting the data choose their preferred format, falling back
on other formats as necessary.

The documentation for .NET support of the clipboard hints at an ability to
do conversions on the fly from clipboard data but a) I have not found the
..NET Clipboard class to always work as advertised, and b) I think this
would only help when pasting into a .NET application. If you want to
support plain text pasting into other applications, you need to include
that format among the data formats you put on the clipboard.

Pete
Jan 26 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4469
by: mescaline | last post by:
//Consider the simple program with inheritance, plain init for A, copy ctr for B #include <iostream> using namespace std; class Base{ public: Base(){cout << "Base, default" << endl;} Base(const Base &){cout << "Base, Copy Ctor" << endl;} };
1
2229
by: Bob T Bunny | last post by:
Hi all, I am trying to copy a form that is in one frame, using a button on another frame. The form has a couple of tables inside it. I can get it working when the button is in the same frame, but not in different ones. I get an "invalid argument" error on the controlRange.addElement(x) line. What I have so far is: <script language='javascript'>
1
3115
by: dixie | last post by:
I am doing a job where I need to copy a letter header into each of about 100 letters which are mail merge template documents for about 20 different customers - all up about 2000 copy and pastes requiring opening each document and deleting the current header and pasting the new one. I have tried to use IncludeText to do this and having the header in a file, but it appears that the client must open each letter and refresh the link before...
4
21626
by: Legendary Pansy | last post by:
I was checking out the 101 C# Samples, specifically Windows Forms - Use the Clipboard. I took a look at the code for a while, and I understand what the program is doing with the cut, copy, pasting via the file menu events using the clipboard. However, what I don't get is how is the program able to produce a context menu in the textbox area. When right clicking, the context pops up and allows to cut/copy/paste/delete, etc.. But the thing is, I...
7
11638
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard is proving to be more difficult. These pictureboxes are bound to an AccessDB. If the user wants to add an image, they select an image using an OpenFileDialog: Dim result As DialogResult = Pic_Sel.ShowDialog() If (result = DialogResult.OK) Then
17
5484
by: emma.sax | last post by:
Hi all, I have a form where we would like the user to input their email address twice, to ensure they've typed it correctly, as is found on most sign-ups I'm looking for a solution to the problem where a user (and me it has to be said) just either highlights the email address with their mouse (or Ctrl-A) and then Ctrl-C, Ctrl-P (or right-click copy, right-click paste) into the next field down.
17
5129
by: Steve | last post by:
I'm trying to code cut, copy, and paste in vb 2005 so that when the user clicks on a toolbar button, the cut/copy/paste will work with whatever textbox the cursor is current located in (I have about 20 textboxes on the form). Also to ensure that the button can't get used if the cursor isn't in a textbox field. And to ensure the contents of the clipboard are "text" contents that have been cut/copied from one of the textboxes on the form. ...
8
1405
by: Wolfgang Draxinger | last post by:
As already noted a few months ago I'm working on a language, that is intended to be compiled into C as an intermediary. ATM I'm working with the latest publically avaliable draft of C99 avaliable from open-std.org. However I was considering to obtain a copy of the real thing, but I wonder if it worth it. Mainly I'm interested in _generating_ standard conforming code. Is it worth it? Also I'd like to know, where to get a copy of the old...
8
15441
by: jh | last post by:
I'd like to copy/paste into a listbox during runtime. I can do this for a textbox but can't figure out how to accomplish this for a listbox. Any help? Thanks.
0
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9336
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.