ActiveXObject vs Object-tag


  • Hi, I want to be able to use ActiveX objects in my HTML. This works perfectly for most objects when doing a var UniqueName = new ActiveXObject("Assembly.Class"); The bad thing about last statement is that I cannot specify which version of the DLL to use in the HTML. Therefore I was using the Object-tag like this: <object id="UniqueName" classid="clsid:E21505B2-9025-330C-BE10-694001AFC7EA" codebase="SomeAssembly.dll#version=1,0,0,0"></object> When using the object tag in HTML, I'm unable to pass that object to other jscript. Here in this example I want to print a document. The document is opened in a new window: window.open("DocumentPrint.htm", "_blank","scrollbars=yes,directories=no,location=no,status=no,resizable=yes"); In that 'DocumentPrint.htm', the onload event takes care of the actual print: <body class="stlPrnWin" onload="PrintDocument(window,window.opener)"> function PrintDocument(win,WinOpener) { MainWinAttest = WinOpener.MainWinDocument; theDocument = WinOpener.parent.UniqueName; //rest of the code When doing this, the variable "theDocument" will not OK when using the Object tag. No problem when using ActiveXObject. Is there someone who can explain to me why this isn't working when I try to use "Object"?
    Monday, January 23, 2012 1:38 PM