Click to See Complete Forum and Search --> : ActiveXObject IE


kopite
06-13-2003, 11:40 AM
Help!!

Using ActiveXObject in IE 5.0 > but am having an [object error] returned on some browser implementations.

code segment is precisely this:
var Word = new ActiveXObject("Word.Document");

throws an [object error] exception.

Any ideas, how can I find whether it is implemented on the client browser, check for plugin? etc ?

Khalid Ali
06-13-2003, 11:48 AM
ActiveXObject do not work with browsers other then IE...so no lugins you can find...

totopo
03-21-2005, 09:59 AM
I have a question:

This works in IE, for what I have been investigating there is no way to do it in Mozilla, am I correct?, but is there any other way this could be accomplished?, maybe with a Java applet?
Please help.

Kind regards

Marco

<script language="javascript" type="text/javascript">
function runApp(myFile)
{
var appWord;

try{

if ( (navigator.userAgent.indexOf('MSIE') != -1) &&
(navigator.userAgent.indexOf('Win') != -1) )
{
appWord = new ActiveXObject("Word.Application");
appWord.Visible = true;
appWord.Documents.Open(myFile);
return true;
}
else
{
//appWord = new ActiveXObject("Word.Application");
//appWord.open("POST",myFile,false);
//appWord.Documents.Open(myFile);
//appWord.send("");
//return true;
alert("Browser not supported");
return false;
}

}catch(e){
alert("Exception: "+e);
return false;
}

}
</script>


<HTML>
<BODY>
<A onClick="runApp('http://localhost:8080/slide/files/Fragebau.doc?documentId=1234&actId=12')" href="http://www.yahoo.com">VA!</a>

</body>

</html>