Solved

How to save richTextBox contents to .doc file?

Posted on 2009-04-14
12
1,128 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

726 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