JavaScript - how to copy ms word document to a div with its formatting

Asked By astor pierre on 11-Jul-12 05:51 PM

I have to copy a ms word document to a div in a web page

function  CopyMyDocument ()
{
var w=new ActiveXObject('Word.Application');
var dest=document.getElementById("tot")
var docText;
var obj;
obj=w.Documents.Open("C://book/WSH.doc");
docText = obj.Content;
dest.innerHTML=docText;

}

unfortunately, the content of  word document is pasted to the div ( id="tot") without  formatting.

Thanks

Jitendra Faye replied to astor pierre on 12-Jul-12 02:29 AM
Try to open word doc inside iframe tag.

like this-

    <iframe id="wordFrame" name="word" src="inner.docx" />
astor pierre replied to astor pierre on 14-Jul-12 09:57 AM
Now What I need is to copy a ms  word document with its HTML formatting   to a clipboard in javascript .


any help is appreciated