Click here to Skip to main content
15,920,896 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a small problem with converting for e.x I cant encode the file int notepad that are with .txt extension using (System.Text.Encoding.Default)

But I dont know how to encode word document I used (System.Text.Encoding.Utf8, System.Text.Encoding.Utf7 and all other properties but didn't work ) ???
Posted

1 solution

Although by the word your question doesn't exactly make sense, I assume you mean the following:

1 You have successfully made your software write a plain text file.

2 Your software failed writing a Microsoft Word document in a way that MS Word could open it.

The problem is that a Word document is a very complex thing. It is able to store format information for almost anything you can ever think of putting into a series of books. Additionally, there is no publically available specification AFAIK.

But there are specialized classes[^] for dealing with Word documents. Using them may need Microsoft Word to be installed on the target machine.
 
Share this answer
 
Comments
h7h7h7 17-Apr-12 9:53am    
Yes, I understood you... the problem is that I can save in .doc format without problem, but I cant read it....!??
lukeer 19-Apr-12 2:33am    
Edit your original question using the "Improve question" link to show us how you save the .doc file (only the relevant code part).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900