Solved

How to save richTextBox contents to .doc file?

Posted on 2009-04-14
12
1,125 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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
 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Not showing JavaScript in the list 5 52
Connection String 16 54
HttpPostedFile 1 26
What Does This C# Code Block Do? 5 24
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 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

16 Experts available now in Live!

Get 1:1 Help Now