473,774 Members | 2,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Save document before printing a RichTextBox c#

4 New Member
Hi all,

Following the instructions of this link http://support.microso ft.com/kb/812425, i've been able to print the content of a RichTextBox control . Apart from that , I want to have the chance to create and save a file with the content of the RichTextBox. I've read a thread (http://www.thescripts. com/forum/thread159382.ht ml) and i've been able to create files. But those files don't have any extension and I dont know how I can open them. I opened them with Notepad,Word... but i just get strange symbols...
-Does anybody now how I can open those files ?
-Is there any way that I can create a .doc file with the content of the RichTextBox? How could I do it ?

Thanks for ur help!
Oct 18 '07 #1
1 2597
txomin
4 New Member
Hi,

I've been able to create and save a .rtf file with the text of a RichtextBox.

private void btnPrint_Click( object sender, EventArgs e)
{
if (this.saveFileD ialog1.ShowDial og() == DialogResult.OK )
if ((this.saveFile Dialog1.FileNam e.Length) > 0)
this.richTextBo xPrintCtrl1.Sav eFile(this.save FileD ialog1.FileName , RichTextBoxStre amType.RichText );
// Instruction to
// Open this.saveFileD ialog1.FileName without showing any OpenDialog.
// Just open it as soon as its created.

But i'd like to pop up the .rtf file that has just been created, without opening any OpenDialog. I mean, click the Print button, choose the location where the .rtf will be created , create it , and pop up the file that has just been created.

Can anyone help me ?
Oct 19 '07 #2

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

Similar topics

3
11263
by: Maya | last post by:
Hey, there! I'm new to vb.net and it seems I wouldn't be able to solve this without help. I have a pipe delimited file that has to be saved in txt format so it could be accepted by my DTS package. If I open and save the file manualy in Wordpad - it works. (not in Notepad otherwise formatting is changed and DTS package won't accept it.)
0
1216
by: Páll Ólafsson | last post by:
Hi I have a question about printing a RichTextBox. Today Im using a function written by Michael Gold. A function that does it all but the speed is an issue in this case. If you are printing a large text it takes ages to print out? Michael Gold Function http://www.c-sharpcorner.com/Code/2003/June/ColorSyntaxEditor.asp
5
7410
by: Poster | last post by:
I have a script, its outputs are in HTML. It displays perferctly in a browser, however when I view source, it gives me the JS scripts, but I want to view the HTML output. Is there a way I can view or save output?
5
2392
by: Urs Vogel | last post by:
Hi When printing coloured text from a RichTextbox, it turns out to be a quite and timeconsuming job to position all differently coloured strings on the Page with DrawString(). Is there a better method of achieving this, or are there samples somewhere? Couldn't find anything on MSDN.
0
11159
by: Vincent | last post by:
Dear all, I have implemented a class to export the content of RichTextBox to image in WYSISYG mode so that line breaks on the screen are the same as exported. C# Code: public struct STRUCT_RECT
2
4595
by: csgraham74 | last post by:
Hi, I have a requirement in work that i give a person the ability to create a html document using a richt text editor. What i then want to do is save the HTML doct to my server & insert reference in a database so that i can retrieve the html document. Basically i dont have a clue how to convert a string in HTML format (taken from the RTE) to an actual document and then save it to a folder. Can anyone point me in the correct direction.
1
1259
by: ooroboo | last post by:
i wont have made a simple program for my self , with 2 tabs a text document and a web browser , i have had a little look and could not find a way to open a Save As dialog for my Richtextbox is this possible or how should it be done? ( i wont the Save as dialog to save the richtextbox.text as a file with an option to change the file name) thanks for your help/ time
1
2299
by: Ang | last post by:
Hi, How can I save two richtextbox contents into a file? if simply join two richtextboxes like joining two string, the output file will not show the value of second richtextbox. Thanks for reply. *** Sent via Developersdex http://www.developersdex.com ***
1
4934
by: Andrus | last post by:
I need to save font selected by user by Ctrl+MouseWheel in Winforms RichTextBox. I tried override below but this does not remember font: in this method Font.Size property seems to be always *initial* Font size when RichTextBox is created, *not* the font size set by ctrl+mouse wheel. How to find the font size set by Ctrl+Mouse wheel ?
0
9454
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
10267
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
10106
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
10040
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
9914
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...
1
7463
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
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
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2852
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.