Search code examples
asp.netxmlxsltopenxml

How do I convert a .docx to html using asp.net?


Word 2007 saves its documents in .docx format which is really a zip file with a bunch of stuff in it including an xml file with the document.

I want to be able to take a .docx file and drop it into a folder in my asp.net web app and have the code open the .docx file and render the (xml part of the) document as a web page.

I've been searching the web for more information on this but so far haven't found much. My questions are:

  1. Would you (a) use XSLT to transform the XML to HTML, or (b) use xml manipulation libraries in .net (such as XDocument and XElement in 3.5) to convert to HTML or (c) other?
  2. Do you know of any open source libraries/projects that have done this that I could use as a starting point?

Thanks!


Solution

  • Try this post? I don't know but might be what you are looking for.