473,750 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem in writing rtf text in wordpad

31 New Member
hello everyone..

In my c# project I want to paste rtf text to wordpad from clipboard.I am using streamwriter for that.

I have three richtextbox.Fro m that I am able to paste only one rtf text to wordpad....

here is my code please help me...

Expand|Select|Wrap|Line Numbers
  1. StreamWriter sw = new StreamWriter("wpreview.wri");
  2.  
  3.                     for (int i = 0; i < count; i++)
  4.                     {
  5.                         child = clpbrd_panel.Controls["chkbox" + i];
  6.                         if (child != null)
  7.                         {
  8.                             if (((CheckBox)child).Checked == true)
  9.                             {
  10.                                 child = clpbrd_panel.Controls["rtextbox" + i];
  11.                                 ((RichTextBox)child).SelectAll();
  12.                                 ((RichTextBox)child).Copy();
  13.                                 idata = Clipboard.GetDataObject();
  14.  
  15.  
  16.                                 if (idata.GetDataPresent(DataFormats.Rtf))
  17.                                 {
  18.  
  19.                                                                                       sw.Write(idata.GetData(DataFormats.Rtf));
  20.                                       sw.WriteLine("");
  21.  
  22.                                 }
  23.                          }
  24.                 }
  25. sw.close();
  26.  
May 2 '08 #1
0 980

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2032
by: MLH | last post by:
Can I open an embedded object frame (OLE Class: WordPad) from an OPEN form, launching WordPad to edit the text contents, close WordPad & have the changed docment SHOW UP in the embedded object frame on the open form after having made the edit? If I can, I'd like to launch the process on click of a button on the form. Any cut 'n paste code that'd kind-a-fit my needs would be appreciated. All suggestions are appreciated. I'll have to...
3
4386
by: MLH | last post by:
I can open WordPad directly (Start, Run...), then open a document & click File, Send... Out goes the email without a hitch. However, if I open WordPad from Access this way... Sub Button1_Click () x = Shell("c:\windows\system32\dllcache\WordPad.exe ", 1) SendKeys "%FOc:\cr\docs\packets\ntrolttr.rtf~", False End Sub
3
1184
by: poldoj | last post by:
First I would thank you all for the replies at my previous post. Say sorry for my poor english also. I have found where my problem came from. I am writing a string to a text box and write the content of that textbox to a file. All is just fine until I try to pass this character to the textbox: exemple: ------ TextBox1.AppendText(Chr(167) )
19
1948
by: alice | last post by:
I'm just learning php, and one of the first things in the book I'm reading has me make this file- <html> <head> <title>PHP Test</title> </head> <body> <p>This is an HTML line <p> <?php
18
2097
by: Scott | last post by:
Hi, a problem with this following code is really bugging me. tform = fopen(country, "r"); fseek(tform, 9L, SEEK_SET); fgets(player2, 38, tform); printf("Player Name (save): %s", player); printf("Player Name (form): %s", player2);
0
930
by: rupali77 | last post by:
hi i want to open my existing wordpad file on button click in vb.net for eq. if i click on button ABC tht shud allow me to open my ABC.txt file(wordpad) if i click on button XYZ tht shud allow me to open XYZ.txt directly in wordpad. help me to get above result thanks
6
8169
by: Adam Sandler | last post by:
Hello, I have a richtextbox and a method which copies the contents of the richtextbox to the clipboard -- like so: Clipboard.SetText(this.richTextBox1.Text); The problem is if there are any returns, and the user pastes the clipboard contents into notepad, all the data appears on one line -- with a bunch of non printing characters (which show up as boxes) where
5
3670
by: =?Utf-8?B?bG9rZWU=?= | last post by:
Hello, I use windows XP ver.2002, Service pack 2. I am getting a very strange error. I am unable to open any file with extension".ini" If I create any text file, type some text and save it with extension ".ini" and try to open it using notepad (or by double clicking), it gives following messege:
0
1378
by: MegaOctet | last post by:
Hello, I'm trying to send some text in wordpad and here is my script: import win32gui import win32api import win32con import time Notepad= win32gui.FindWindow(None,"Sans titre - Bloc-notes") win32gui.SetForegroundWindow(Notepad) editbox = win32gui.FindWindowEx(win32gui.GetDesktopWindow(),None,"Notepad",None)
0
8838
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
9396
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
9339
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
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6081
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
4887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2225
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.