How to save richTextBox contents to .doc file?

Anyone please tell me how to save all contents of richTextBox to .doc files without changing format.

Thanks!
Mr_BachAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
abelConnect With a Mentor Commented:
or, more specifically:

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

-- Abel --
0
 
abelCommented:
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
 
abelCommented:
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
RiteshShahCommented:
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
 
RiteshShahCommented:
coagantus, I am sorry both the links you provided doesn't seem relevant for author's case.
0
 
Mr_BachAuthor Commented:
I am so sorry, so how to save to .RTF?

0
 
RiteshShahCommented:
are you using any 3rd party rich text box?
0
 
RiteshShahCommented:
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
 
abelCommented:
> I am so sorry, so how to save to .RTF?

what about:

RichTextBox1.SaveFile("mypath.rtf")
0
 
Mr_BachAuthor Commented:
Thanks Mr. Abel ! I got it.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.