Solved

How to save richTextBox contents to .doc file?

Posted on 2009-04-14
12
1,123 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem with SqlConnection 4 160
New to SOAP and need some direction 10 45
Get id from json Data with NewtonSoft 3 34
In WPF / C# binding a local database in code behind 1 24
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 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

13 Experts available now in Live!

Get 1:1 Help Now