0

I want to be able to display a .docx file or a word .xml file in a web page and keep the formating. I am writing a book for fun but want to put it out on my web page every weekend. All I want to have to do is upload the Word document to the web site.

Code

<!DOCTYPE html>
<html>
<body>

<script>
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
    xmlhttp.open("GET","MyWorddocument.xml",false); <-- This should open the file
    xmlhttp.send();
    xmlDoc=xmlhttp.responseXML; 
</script>

</body>
</html>

Do I need to have to iterate through it with some Javascript?

Doug Hauf
  • 3,025
  • 8
  • 46
  • 70
  • 2
    If you go with that approach, you'll have to write a Word to HTML converter in JavaScript. – Quentin Jan 16 '14 at 20:59
  • seems like the best approach is to use word's convert to html feature. you can do it on server side using some microsoft office api/dlls. especially if this is an asp .net site. http://stackoverflow.com/questions/3967191/library-to-convert-word-document-text-to-html. – CodeToad Jan 16 '14 at 21:03
  • Can I just save the word document and then display it as a page inside of a page. – Doug Hauf Jan 16 '14 at 21:25

0 Answers0