title: How to get a COM reference to an Internet Explorer instance embedded in another application
body: <p>The Dynamics plugin for Outlook displays content via an Internet Explorer embedded window.  I'm trying to find a way to get at the SHDocVw.InternetExplorer COM object for that embedded window.  Our application runs stand-alone (it's not an Outlook or IE add-in) and we are not at all in control of creation of the embedded IE window.</p>
  
  <p>When I use:</p>
  
  <pre><code>Dim SWs As SHDocVw.ShellWindows
  Set SWs = New SHDocVw.ShellWindows
  </code></pre>
  
  <p>the SWs collection does not contain a reference to the embedded browser in Outlook (though I do get references to regular browser windows).</p>
  
  <p>Using Spy++, I see the following window hierarchy for the embedded Outlook window:</p>
  
  <pre><code>Window "xxxxxx" WindowsForms10.Window.8.app.0.5c39d4_r64_ad2
    - "" Shell Embedding
      - "" Shell DocObject View
        - "" Internet Explorer_Server
  </code></pre>
  
  <p>The last two windows in the hierarchy (Shell DocObject View and Internet Explorer_Server) are exactly the same as for the embedded viewer in a running Internet Explorer instance.</p>
  
  <p>It seems like there must be some way to get a COM reference to these embedded browsers - any help or ideas would be greatly appreciated.</p>