Results 1 to 4 of 4

Thread: Help with webbrowser

  1. #1

    Thread Starter
    Addicted Member RoYeti's Avatar
    Join Date
    Dec 2005
    Posts
    165

    Arrow Help with webbrowser

    Who know how to open a page from webbrowser to iexplorer ?
    For example:
    VB Code:
    1. Private Sub Form_Load()
    2.     WebBrowser1.Navigate "http://www.google.com/"  
    3. End Sub
    4.  
    5. Private Sub Command1_Click()
    6.     ' Here what to write ? to open the content of WebBrowser1 ? it can be a web page that i don`t know his name
    7. End Sub
    Tenx
    Last edited by RoYeti; Apr 11th, 2006 at 02:54 PM.

  2. #2
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Re: Help with webbrowser

    You don't have to do this!

    Just do the following!
    VB Code:
    1. Dim sPag As String
    2. sPag = "http://www.google.com/"
    3. Shell "Explorer.exe " & sPag, vbNormalFocus

    Change sPag value to any web site's url! It will load the IExplorer for the web site url!


    I hope I helped you!
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  3. #3
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Help with webbrowser

    VB Code:
    1. Private Declare Function ShellEx Lib "shell32.dll" Alias _
    2. "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
    3. ByVal lpFile As String, ByVal lpParameters As Any, _
    4. ByVal lpDirectory As Any, ByVal nShowCmd As Long) As Long
    5.  
    6.  
    7. Private Sub Command1_Click()
    8.     Dim x
    9.     x = ShellEx(Form1.hwnd, "open", WebBrowser1.LocationURL, "", "", 1)
    10.    
    11. End Sub
    12.  
    13.  
    14. Private Sub Form_Load()
    15.     WebBrowser1.Navigate "www.vbforums.com"
    16. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,728

    Re: Help with webbrowser

    I wouldn't use ShellExecute if I want the page to open explicitely in IE. It will open the page in default browser. My default browser is Opera.

    You can use both Shell (like DarkX_Greece said) And LocationURL (like static said) to open the page in IE.
    VB Code:
    1. Private Sub Command1_Click()
    2.     Call Shell("EXPLORER.EXE " & Chr$(34) & WebBrowser1.LocationURL & Chr$(34))
    3. End Sub
    But if you need more control over the new window, use Penagate's code. (Use IE.Navigate2 WebBrowser1.LocationURL)
    Last edited by iPrank; Apr 11th, 2006 at 09:47 PM.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


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