Click here to Skip to main content
15,851,701 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My project requires to convert user uploaded edtiable documents to non-editable format in .net. We are supporting many file formats including DOC/DOCX (only editable type). Already my client is being used Ecrion -XF Rendering Server 2008 engine for some other project. They are not ready to buy new licensed product(aspose.word,etc.,) But the problem is ecrion will only support WordML(Word 2003 and later) and DOCX (word 2007 and later).It will not support .DOC(1997-2003).

It would be really helpful if anyone give me the solution/code of how to convert .DOC(word 1997-2003) to WordML/DOCX without installing word in our machine and also from an open source.

Please help me..
Posted

1 solution

Hello

A question similar to this one has been asked already please have a look at this post:
How to convert a .doc, .docx file in .html[^]

It will work between doc and docx.

Also, at msdn someone has asked more directly the idea between word file

http://social.msdn.microsoft.com/Forums/en-US/f51bdd0c-b022-45c6-8af5-6ed79ad576fd/convert-doc-to-docx-?forum=vsto[^]
I'm quoting here the example just in case this last link ever gets deleted

C#
object oOpenName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + \\TestSaveDoc.doc;

object oSaveName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\TestSaveDoc.html";

object oHTMLFormat = Word.WdSaveFormat.wdFormatHTML;

 

Word.Document doc = wdApp.Documents.Open(ref oOpenName, ref missing, ref missing,

ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,

ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);

 

doc.SaveAs(ref oSaveName, ref oHTMLFormat, ref missing, ref missing, ref missing,

ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,

ref missing, ref missing, ref missing, ref missing, ref missing);


I hope it helps

Regards
 
Share this answer
 

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