Get the IFrame document on document complete2

Add-in Express™ Support Service
That's what is more important than anything else

Get the IFrame document on document complete2
Get the IFrame document on document complete2 
Liron Lev




Posts: 11
Joined: 2013-10-09
Hi,
We are working on web-page with iframes.
On document_complete2 events we can see by the URL that we got an iFrame, but the
this.htmlDocument
refers to the parent document.
We need, if possible, to get each iframe element / document.

Thanks in advanced,
Liron
Posted 10 Jun, 2014 03:16:49 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Hello Liron,

        private void IEModule_DocumentComplete(object pDisp, string url)
        {
            if (pDisp is IE.IWebBrowser)
            {
                mshtml.IHTMLDocument2 doc = (pDisp as IE.IWebBrowser).Document as mshtml.IHTMLDocument2;
                //System.Diagnostics.Debug.WriteLine("!!! " + doc.frames.length.ToString() + " " + doc.url);
            }
        }



Andrei Smolin
Add-in Express Team Leader
Posted 10 Jun, 2014 04:46:20 Top
Liron Lev




Posts: 11
Joined: 2013-10-09
Hi thanks for the quick answer!

Is there any way to get a reference to the iFrame who got the document complete?

Thanks,
Liron
Posted 10 Jun, 2014 06:13:41 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
Liron,

When you get Documentcomplete for the page shown by the corresponding IFRAME element, the IFRAME element isn't available as it is being constructed by the main document; you can access the main document when you get DocumentComplete for it.


Andrei Smolin
Add-in Express Team Leader
Posted 10 Jun, 2014 06:41:38 Top
Liron Lev




Posts: 11
Joined: 2013-10-09
OK,
Thanks!

Liron
Posted 10 Jun, 2014 07:52:31 Top
Andrei Smolin


Add-in Express team


Posts: 18825
Joined: 2006-05-11
No problem.


Andrei Smolin
Add-in Express Team Leader
Posted 10 Jun, 2014 08:00:31 Top