[thelist] Opening MS word document by Javascript . Getting error:Automation server can not create object

Chris at globet.com Chris at globet.com
Wed Dec 7 07:52:02 CST 2005


Asit

>   I'm trying to open MS word document by Javascript using IE  
> browser . 
>   The code segment 
>    
>     var objWord = new ActiveXObject("Word.Application");
>   var Doc=new ActiveXObject("Word.Document");
>   Doc.Visible = true;
>   Doc=WApp.Documents.Add("c:\\SFDemoSpec&Doc\\test.dot", true);
>    
>   This is giving me 
>    
>   Automation server can not create object at line no 1 as well as 2 .
>   Can u pls help me in this regards ...how to do it  ? ..

Googling for "javascript open word document" yielded the following link.

<http://www.faqts.com/knowledge_base/view.phtml/aid/6330/fid/53>

I used the following code (from the link above), which opened up an
instance of MS Word with a blank document:

var wordDoc=new ActiveXObject('Word.Document'); 
// creates a new ActiveX object
wordDoc.Application.Visible=true;
// displays the application (Word) with the (empty) document loaded
// ...
// Do here whatever you like
// ...
wordDoc=null;  // dispose of the reference

This should give you a good starting point.

HTH

Chris Marsh
Web Developer
http://www.globet.com/
Tel: +44 20 8246 4804 Ext 828
Fax: +44 20 8246 4808

Any opinions expressed in this email are those of the individual and not
necessarily the Company. This message is intended for the use of the
individual or entity to which it is addressed and may contain
information that is confidential and privileged and exempt from
disclosure under applicable law. If the reader of this message is not
the intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly prohibited.
If you have received this communication in error, please contact the
sender immediately and delete it from your system. 



More information about the thelist mailing list