How to open urls from AdvancedBar in the current IE window ?

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

How to open urls from AdvancedBar in the current IE window ?
 
Ivars Borščevs




Posts: 9
Joined: 2011-11-07
I am currently implementing the IE advanced bar with the WebBrowser component embedded in the bar. The WebBrowser opens url fr om our site and shows updates which may contain some urls. Currently if user clicks on urls in the Advanced Bars WebBrowser component these urls get opened in new Internet Explorer windows (looks like urls are using a href parameter TARGET = "_blank")

Is it possible to open these urls from the WebBrowser component in the currently open Internet Explorer window which contains the bar with the WebBrowser (I mean not in the bar itself but in the part of Internet Explorer window wh ere the user browsing occurs)?
Posted 07 Nov, 2011 09:40:19 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
Hi Ivars,

Yes, it is possible. You need to customize your WebBrowser control.
Please visit the following web site devoted to WebBrowser customization:
http://msdn.microsoft.com/en-us/library/aa770041(v=vs.85).aspx
Posted 07 Nov, 2011 09:47:07 Top
Ivars Borščevs




Posts: 9
Joined: 2011-11-07
Thanks for the quick answer, but maybe you can point me to some resource where it is done in VB.NET?

I just looked at WebBrowser events in VB.NET and there is no such event as NewWindow2 there is only NewWindow event and it looks different from the NewWindow2 event described in the url you provided.
Posted 07 Nov, 2011 10:19:24 Top
Ivars Borščevs




Posts: 9
Joined: 2011-11-07
Ok, I managed to catch user clicks on links by adding the following event handler to the WebBrowser component in the IE Advanced Bar:


Private Sub WebBrowser_NewWindow(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser.NewWindow

        e.Cancel = True
        IEApp.Navigate(WebBrowser.Document.ActiveElement.GetAttribute("href"))

  End Sub
Posted 07 Nov, 2011 11:36:05 Top
Sergey Grischenko


Add-in Express team


Posts: 7228
Joined: 2004-07-05
Hi Ivars,

Thank you for sharing your solution.
Posted 08 Nov, 2011 03:29:28 Top