Solved

How to save richTextBox contents to .doc file?

Posted on 2009-04-14
12
1,122 Views
Last Modified: 2012-05-06
Anyone please tell me how to save all contents of richTextBox to .doc files without changing format.

Thanks!
0
Comment
Question by:Mr_Bach
  • 4
  • 4
  • 2
  • +1
12 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24136691
You can do it the same way you save it as RTF file, just rename it. Word will understand the RTF format is used and will show the correct format.
0
 
LVL 39

Expert Comment

by:abel
ID: 24136701
Note that this is considered bad practice, however, and it is better to just save it as RTF file (i.e, like in xxxyyyzzz.rtf) which will automatically open with Word if Word is installed.
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24136989
well as per my opinion you should save it in .RTF only as there are few ways to save it in .DOC but it will need office library to installed in your application which will create burden on your application so I would insist you to save it as RTF and open it in word.

Do you have any special requirement to save it as DOC? if so than we can probably find out solution to it as a workaround or permanent

0
 
LVL 3

Expert Comment

by:coagantus
ID: 24137003
0
 
LVL 3

Expert Comment

by:coagantus
ID: 24137013
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24137060
coagantus, I am sorry both the links you provided doesn't seem relevant for author's case.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Mr_Bach
ID: 24137282
I am so sorry, so how to save to .RTF?

0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24137336
are you using any 3rd party rich text box?
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24137389
BTW, this link could be helpful.

http://forums.asp.net/t/1260657.aspx

http://www.experts-exchange.com/Programming/Languages/.NET/Class_Libraries/Windows_Forms/Q_23235545.html


if you want to get good RTF control and save the file from it than go for below link.
http://freetextbox.com/default.aspx
0
 
LVL 39

Expert Comment

by:abel
ID: 24137437
> I am so sorry, so how to save to .RTF?

what about:

RichTextBox1.SaveFile("mypath.rtf")
0
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24137442
or, more specifically:

   RichTextBox1.SaveFile("mypath.rtf", RichTextBoxStreamType.RichText)

-- Abel --
0
 

Author Comment

by:Mr_Bach
ID: 24137501
Thanks Mr. Abel ! I got it.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now