[Last Call] Learn how to a build a cloud-first strategyRegister Now


Navigate URL . . . . .

Posted on 2004-11-30
Medium Priority
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) ,
1. yahoo.com
2. msn.com
3. hotmail.com

if 2nd explorer change url from msn.com to msn.com/asd/sdf.srf 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 "experts-exchange.com" 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
  • 3
  • 2
LVL 19

Expert Comment

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


LVL 32

Expert Comment

ID: 12716321
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

ID: 12723192
Thanks for reply,

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 12723757

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

Accepted Solution

Erick37 earned 400 total points
ID: 12726592
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 google.com
        If InStr(1, LCase(ie.LocationURL), "experts-exchange.com") Then
            ie.Navigate2 "http://www.google.com"
            Do While ie.ReadyState <> READYSTATE_COMPLETE: DoEvents: Loop
        End If
    End If

Author Comment

ID: 12733135

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 Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

831 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