How to get a reference to IE Window?

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

How to get a reference to IE Window?
to use window.external javascripts in a web browser running in a sidebar. 
Juan Carlos Ruiz Pacheco




Posts: 40
Joined: 2010-05-11
Hi, I have a Sidebar , in this sidebar exists a WebBrowser displaying a webpage,
in this webpage i have a javascript to install some web slices for the user, but the script doesnt work because in its context window.external doesn't exist.

Looking around internet I found that you could use WebBrowser.ObjectForScripting to set the external window, if you are using a windows form you can set this property to reference the current form...

but because of the script needs to run under IE8 broswer i believe i need to set WebBrowser.ObjectForScripting to IE window, but I don't know where in Add-In Exprress can I find this IE Window object.

plz helpme.
Juan Carlos Ruiz
Microsoft MVP Visual C#
Systems Engineer
MCP, OCA, OCP
Posted 24 May, 2010 09:07:30 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Juan.

You can use the following code: this.HTMLDocument.parentWindow
Posted 24 May, 2010 11:40:24 Top
Muller Stephan




Posts: 50
Joined: 2010-03-11
e.g.

this.HTMLDocument.parentWindow.execScript("alert('hello');","javascript")


should work fine .-)
Posted 28 May, 2010 07:22:29 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Stephan.

Thanks for the help.
Posted 28 May, 2010 09:21:16 Top