Navigate URL . . . . .

Posted on 2004-11-30
Last Modified: 2010-05-02

I have a small problem, (i m not good in english but), if i have open 3 IE(Internet Explorer) ,

if 2nd explorer change url from to etc. so when it change then i want to navigate my own url to the 2nd explorer means when 2nd explorer changing then i want to my software detect it and navigate my url "" so how can i do this thats not for 2nd explorer randomly if any one of explorer process some thing then my software read or detect process of explorer and detect explorer id and navigate my own url so how can plz any one help me.

if any one not understan my english then post comments. i'll be try best for him/her.

Thanks and waiting for ur response.
Question by:stingkhan
    LVL 19

    Expert Comment

    You need to create a browser helper object, this cannot be done in visual basic, its typically done in C++.

    LVL 32

    Expert Comment

    A BHO can be written in VB with a little help:

    VB Sample:

    Browser Helper Objects: The Browser the Way You Want It

    Author Comment

    Thanks for reply,

    Thats not enogh i want to do it in vb and must do it. any more help plz.


    Author Comment


    Erick and BrianGEFF719 u r in top list plz solve my problem
    LVL 32

    Accepted Solution

    If you want to look at each running instance of IE and view and or modify the location URL, then you have 2 options which I know of:

    1) Use a Browser Helper Object.  This runs inside IE and can tap into the navigate events directly.  Difficult to do in VB, but the link above shows how.

    2) Use a standard VB program to loop through each running instance of IE and view / modify the location URL.  This is not event driven, so you will have to use polling with a timer or some other method to run the code.

    Example of #2

    'From the Project->References menu, add a reference to "Microsoft Internet Controls"

    Dim shWnd As New ShellWindows
    Dim ie As InternetExplorer

    'Loop through each Explorer window
    For Each ie In shWnd
        'Filter out Windows Explorer windows
        If InStr(1, LCase(ie.FullName), "iexplore.exe") Then
            Debug.Print ie.LocationURL
            'Do something with ie here: redirect all EE browsers to
            If InStr(1, LCase(ie.LocationURL), "") Then
                ie.Navigate2 ""
                Do While ie.ReadyState <> READYSTATE_COMPLETE: DoEvents: Loop
            End If
        End If

    Author Comment


    Erick u r gr8, ur code is not for my project but i got an idea from it and finish my project.

    thanks Erick

    and also thanks BrainGeff : )

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now