Link to home
Start Free TrialLog in
Avatar of Mr_Bach
Mr_Bach

asked on

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!
Avatar of abel
abel
Flag of Netherlands image

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.
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.
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

coagantus, I am sorry both the links you provided doesn't seem relevant for author's case.
Avatar of Mr_Bach
Mr_Bach

ASKER

I am so sorry, so how to save to .RTF?

are you using any 3rd party rich text box?
BTW, this link could be helpful.

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

https://www.experts-exchange.com/questions/23235545/RichTextBox-Save-as-text-with-formatting.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
> I am so sorry, so how to save to .RTF?

what about:

RichTextBox1.SaveFile("mypath.rtf")
ASKER CERTIFIED SOLUTION
Avatar of abel
abel
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mr_Bach

ASKER

Thanks Mr. Abel ! I got it.