473,480 Members | 1,506 Online
Bytes | Software Development & Data Engineering Community
Create 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.From 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 965

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

Similar topics

0
2017
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...
3
4359
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...
3
1166
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...
19
1927
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
2060
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);...
0
907
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...
6
8135
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...
5
3642
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...
0
1352
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")...
0
7044
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,...
0
6908
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...
0
7087
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...
0
6944
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...
0
5341
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,...
1
4782
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4483
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...
0
2985
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
182
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...

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.