How to read in URL from IE into VB program

Sharky Forums


Results 1 to 2 of 2

Thread: How to read in URL from IE into VB program

  1. #1
    Hammerhead Shark
    Join Date
    Sep 2000
    Location
    Washington DC
    Posts
    1,286

    Post How to read in URL from IE into VB program

    Hey, I'm trying to make a simple VB program which needs to read in the URL string from IE and then process/use the information. How do I read in the URL from the most recent IE window into a VB program? I'm sure it can be done b/c I've used programs which will automatically read in the URL from my browser, and that's exactly what I want to do. Any help, tips, or links to were I might find help would be greatly appriciated. Thanks, sicko

  2. #2
    Mako Shark dighn's Avatar
    Join Date
    Nov 2000
    Location
    Vancouver, BC Canada
    Posts
    3,171

    Post

    check out this simple code:

    Dim blah As New ShellWindows
    Dim i
    For i = 1 To blah.Count Step 1
    Print (blah(i - 1).LocationURL)
    Next i

    it will print out windows explorer's locations as well but you can check the urls to only use the ones with http:// or something

    to make it work you need to reference the dll shdocvw.dll (in system folder)... project->references

    ------------------
    Keep it brief

    [This message has been edited by dighn (edited September 13, 2001).]
    .

Posting Permissions

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