views:

2688

answers:

3

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!

+3  A: 

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

Adam Lerman
+1  A: 

Word 2007 has an API that you can use to convert to HTML. Here's a post that talks about it http://msdn.microsoft.com/en-us/magazine/cc163526.aspx. You can find documentation around the API, but I remember that there is a convert to HTML function in the API.

Vaibhav