Click here to Skip to main content
15,851,514 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:

I have a project that i am building and for a click event i want to navigate to various URL's.
I am using Visual Studio 2013 and Add-in express tool to create the Add-on for IE, which includes a toolbar with a Button and ContextMenuItem contining drop down of various iteam navigating to various URL's.
But when i am clicking on the items it opens up a new window in IE rather that opening it up in the same active window.
Can someone help me here to open the URL in the new tab in the active window.
This is my Code that i have written for now.

Private Sub FBToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles FBToolStripMenuItem.Click
Dim objIE As SHDocVw.InternetExplorer
objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = True
End Sub
Updated 2-Sep-14 9:18am
Sergey Alexandrovich Kryukov 2-Sep-14 12:42pm    
I saw the solutions you can find on the Web yourself. This is something unreliable. I would say, you could much easier embed the browser in your application using WebBrowser control. Create your own tabs. You will get everything under your control, all in one application.
Even if you make your use of IE perfect, you application will be uglier that that anyway.
sunnyy143 2-Sep-14 13:13pm    
Actually i am looking to develop a Add-on for IE so there is no point of me creating a separate webbrowser.
Please suggest the code for me to open that click instance in a new tab on IE.
Sergey Alexandrovich Kryukov 2-Sep-14 13:35pm    
You should have told that in your question...
sunnyy143 2-Sep-14 14:20pm    
My bad i was searching a lot in these days and was out of options and didnot find any solution for this hence i missed the details and posted the thing i was directly looking for.
Sergey Alexandrovich Kryukov 2-Sep-14 14:29pm    
Not a big problem, just please try to put a comprehensive question in first place, to avoid causing waste of time.

As to you question: I would like to help, but I almost never use IE and cannot imagine that writing plug-ins for a particular browser, especially IE, could be useful :-), so I'm ignorant enough in this topic. :-)


You code is not even resemble something an IE extension should be...
From external code you can not force IE to open new page in active tab - it totally depends on how the user configured IE, however from an extension you can do a lot more (remember you are part of IE now)...
You may start reading here:[^]
Share this answer
sunnyy143 2-Sep-14 14:51pm    
SOrry if my code did not make sense initially, could you please review the question once again as i have updated it now and also let me know the exact code for it as i am not that much aware of coding and need you expert view to complete this.
Kornfeld Eliyahu Peter 2-Sep-14 14:56pm    
Your code still do not make sense, and it's still not code for extension. Please spend some time on learning how to develop an IE extension...
sunnyy143 2-Sep-14 14:58pm    
Thanks, but as mentioned i am using this tool Add-in Express which help me create an extension in the toolbar of the IE where i am just left with writing the code for navigation to URL's. I have looked into various articles but was not able to map anything to this.
There is no current directives that determine whether the new page will open in a tab or a new window. This is browser setting user configurable.[^]
Share this answer
Sergey Alexandrovich Kryukov 2-Sep-14 13:38pm    
This is correct, but unrelated to OP's question (which is not clear enough, that's why you could be confused; so I don't want to blame you :-). OP wants to create an IE plug-in. (Can anyone explain to me why would anyone do that, ever? :-)
sunnyy143 2-Sep-14 14:12pm    
Apologies for not mentioning the details in the question, i am developing an add-on for IE in .NET using VB.
I have developed the add-on in Visual Studio 2013 and used this extension tool "Add-in express" to replicate the add-on on the browser and it works fine.
I have included a button and contextmenuitem in the toolbar and each iteam in the context menu navigates to a URL and the code is as mentioned in the question.
Can someone help me now please.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900