Results 1 to 4 of 4

Thread: VB - Open URL from code in a *new* IE browser window

  1. #1

    Thread Starter
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    VB - Open URL from code in a *new* IE browser window

    VB Code:
    1. Public Sub OpenURL(iURL As String)
    2. On Error Resume Next
    3.  
    4.     Dim Temp As Object
    5.    
    6.     'Create instance
    7.     Set Temp = CreateObject("InternetExplorer.Application")
    8.    
    9.     'Open URL
    10.     Temp.Navigate2 iURL
    11.     Temp.Visible = True
    12. End Sub

  2. #2
    Let me in .. techyspecy's Avatar
    Join Date
    Aug 2002
    Location
    Back to VBF.
    Posts
    2,456
    Cheers pal, Thats nice.

  3. #3
    Frenzied Member ae_jester's Avatar
    Join Date
    Jun 2001
    Location
    Kitchener Ontario Canada Earth
    Posts
    1,545
    Do you need to add a reference to make this work? When I try it, it opens a blank screen every time.


  4. #4
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    another way would be this :
    Code:
    Private Sub Command1_Click()
        ExecLink "http://google.com", vbNormalFocus
    End Sub
    
    Private Sub ExecLink(Url As String, style As VbAppWinStyle)
        Shell "explorer.exe " & Url & "", stlye
    End Sub
    Last edited by dynamic_sysop; Jun 7th, 2003 at 05:07 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width