Results 1 to 8 of 8

Thread: internet explorer

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    17

    internet explorer

    hi all,

    im aiming to open an instance of ie in my vb application. i have added brwWebBrowser control to it but how do i get it to navigate to the web page i want??

    any thoughts would be greatly received


    ps great site!!!!!!!!!!!!!!!!

  2. #2
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    651

    Re: internet explorer

    try
    VB Code:
    1. WebBrowser1.Navigate "http://www.vbforums.com"
    If not some one will correct me

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    17

    Thumbs up Re: internet explorer

    thanks that did it!!!

  4. #4
    Fanatic Member
    Join Date
    Mar 2005
    Posts
    651

    Re: internet explorer

    Great,
    Please don't forget to add a check mark and (resolved) to the title of your post.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    17

    Re: internet explorer

    ok so the webpage opens, great!
    but now i wanna get it to set focus then send keys to use the search engine. so far its not working!
    my code

    VB Code:
    1. If Len(StartingAddress) > 0 Then
    2.  
    3.         'try to navigate to the starting address
    4.         WebBrowser1.Navigate "http://www.hmv.co.uk"
    5.         WebBrowser1.SetFocus
    6.         SendKeys "{TAB 8}", True  ' tab 8 times
    7.          SendKeys "hello"
    8.         SendKeys "{ENTER}", True
    9.        
    10.     End If

  6. #6
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: internet explorer

    I believe someone asked this for Google the other day. Instead of typing "hello" into the box, why not navigate to the actual search page, and just fill in the search parameters? For Example:
    VB Code:
    1. WebBrowser.Navigate2 "http://www.google.com/search?q=Hello"
    2. 'or
    3. WebBrowser.Navigate2 "http://www.google.com/search?q=Visual+Basic+6+Tutorials"
    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  7. #7
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: internet explorer

    You can take a look at using the DOM way of doing things.


    http://www.vbforums.com/attachment.p...chmentid=36095

  8. #8
    Lively Member CodeBlock's Avatar
    Join Date
    May 2005
    Location
    The_Universe.Milky_Way. Solar_System.Inner_Ring. The_Earth.Asia. India.TN. Chennai. Home_Sweet_Home
    Posts
    85

    Re: internet explorer

    Hello parker,

    Its better to do it the QueryString instead of writing too much code using DOM.

    If you need any spoon feeding on how to do that:

    Open a browser and goto your desired search engine website
    type the URL
    type "test" in the search box and press Enter
    now after you get the search result, copy the URL:

    Code:
    http://www2.hmv.co.uk/hmvweb/simpleSearch.do?pGroupID=-1&simpleSearchString=test&primaryID=-1&btnSearchGo.x=13&btnSearchGo.y=9
    Note the bolded "test". The text we typed for. So, all we got to do is to replace with the search string you want

    Here is the code:
    VB Code:
    1. MySearchString = "hi there"
    2.    
    3.     sURL = "http://www2.hmv.co.uk/hmvweb/simpleSearch.do?" & _
    4.             "pGroupID=-1&simpleSearchString=" & Replace(MySearchString, " ", "+") & _
    5.             "&primaryID=-1&btnSearchGo.x=13&btnSearchGo.y=9"
    6.    
    7.     WebBrowser1.Navigate2 sURL

    you might optionally write a function to encode the search string in the %XX format.

    HTH
    Neo

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