title: ActiveXObject javascript Events
body: <p>I want to utilize events from the IE activex object and can't seem to get it to work.</p>
  
  <p>Please see code below and lemme know if any idea's come to mind:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
     &lt;title&gt;Automate IE&lt;/title&gt;
     &lt;script type="text/javascript" language="javascript"&gt;
       var ie = new ActiveXObject( "InternetExplorer.Application" );
       [...some calls to ie functions...]
     &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      This is a test for IE automation.
    &lt;/body&gt;
  </code></pre>
  
  <p>Now I want to be able to use events for the 'ie' object as listed here:<a href="http://msdn.microsoft.com/en-us/library/aa768400%28v=vs.85%29" rel="nofollow">MSDN IE Events</a></p>
  
  <p>But can't seem to get it to work...I tried the following solutions (none worked):</p>
  
  <p>Approach 1:</p>
  
  <pre><code>1. eval( "function ie::EventName(){return MyCustomEvent()}" ); - no joy )-:
  </code></pre>
  
  <p>Approach 2:</p>
  
  <pre><code>2. &lt;script for="ie" event="EventName"&gt;some code here&lt;/script&gt; - still no joy )-:
  </code></pre>
  
  <p><strong>This file is saved with the 'HTA' extension - and runs with the MSHTA scripting host</strong></p>
  
  <p>Any advise \ help on how to do this would be much appreciated...thanks!</p>