jQuery addClass example

Change class name on click in jQuery

by Dhanck

HTML

<p><input type=button onClick="loadworddoc();" value="Load">

       <p><input type=file name=hello>

       <p><textarea name=myarea cols=50 rows=5>nothing here yet</textarea>

       <object ID="tbContentElement" CLASS="tbContentElement" 

         CLASSID="clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A" VIEWASTEXT

         width="450" height="300">

         <param name=Scrollbars value=true></object>

JavaScript

function loadworddoc(){

        // creates the word object

        var doc = new ActiveXObject("Word.Application"); 

        // doesn't display Word window

        doc.Visible=false; 

        // specify path to document

        doc.Documents.Open(document.all.hello.value); 

       

       //copy the content from my word document and throw it into my variable

       var txt;

       txt = doc.Documents(document.all.hello.value).Content;

       //document.all.myarea.value = txt;

       document.all.tbContentElement.DOM.body.innerHTML = txt;

       // quit word (very important or you'll quickly chew up memory!)

       doc.quit(0); 

       }

       //-->