1

I'm trying to create a little executable that when launched opens an IE browser to various websites like news sites all in different tabs. for example, a tab for wsj, nytimes, etc. How do I access IE with vb.net? What reference do I need to add? I can't find any sample code that I can make work I think it is because I am missing a library in my assembly?

3 Answers 3

4
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    OpenURL("www.google.com")

End Sub


Private Sub OpenURL(ByVal URL As String)
    System.Diagnostics.Process.Start(URL)

End Sub

'Or

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim TheBrowser As Object = CreateObject("InternetExplorer.Application")
    TheBrowser.Visible = True
    TheBrowser.Navigate("www.google.com")


End Sub

'Or add Reference SHDocVw.dll By Browsing System32

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim TheBrowser = New SHDocVw.InternetExplorerMedium
    TheBrowser.Visible = True
    TheBrowser.Navigate(URL:="http://www.google.com")

End Sub
0

You can't open them in tabs:

Programmatically open a new tab in ie7

2
  • But, I am fine with adjusting a tab setting on my browser. I have done this and still cannot get it to open with tabs. I now open 6 instances of my browser. I'd prefer to open one instance with 6 tabs. What is winforms webbrowser control?
    – unsure
    Dec 10, 2009 at 14:59
  • Microsoft has decided that applications don't get to decide, period. They might add this in IE9 but don't hold your breath. The WinForms webbrowser control allows you to put an instance of IE on your forms.
    – Stu
    Dec 10, 2009 at 17:23
0

Is your application a console application? You can't create multiple tabs, but you can use a System.Diagnostics.Process to launch individual instances of Internet Explorer. You should be able to simply specify the full address of the website as the Process to run, similar to how you can put "http://www.wsj.com" into a run prompt, which will launch your default browser with the Wall Street Journal's website.

If you are using WinForms, you could always use a WebBrowser control, but that has limitations for tabs as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.