Document Complete event not firing

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

Document Complete event not firing
IEModule Document Complete event not firing during page refresh. 
Anoop Kovoor




Posts: 19
Joined: 2012-11-06
Hi,

I've some important piece of code on IEModule document complete event, where I'm adding some css styles to the page after it is downloaded. My problem is that when doing a page refresh using "IE.WebBrowser.Refresh()" or "IE.WebBrowser.Refresh2()", the document complete event is not fired. But when I'm pressing "F5" the document complete event is fired properly. Please suggest me a solution for the same.

Thanks and Regards,
Anoop
Posted 04 Dec, 2012 04:35:15 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Anoop,

You can use the OnBeforeRefresh event of the iemodule to start a timer. Then you need to check the ReadyState property of the browser and if it is 'READYSTATE_COMPLETE', you can inject your CSS.
Note, to use the OnBeforeRefresh event you need to set the HandleDocumentUICommands property of iemodule to true.
Posted 04 Dec, 2012 10:38:01 Top