How to get text from Internet Explorer Address Bar to vb6 TextBox .....

I've a problem, i want source code, how to get text from Internet Explorer AddressBar to Textbox in Visual Basic 6 e.g: when user enter some url eg then I want to capture this url address on click or change event.  

Waiting for ur positive and nice response.           Thanks
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
See this by Ark if make help:

Receive Events from and Send Events to Open IE Windows

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AsifBangashAuthor Commented:

Dear Ryancys,

thx for reply but i want it in text box and i m saving it in database when textbox got text from it. and that will be unvisible to user.
AsifBangashAuthor Commented:
Dear Ryancys,

thx for reply but i want it in text box and i m saving it in database when textbox got text from it. and that will be unvisible to user.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Ryan ChongCommented:

If you mean grab the web page content, you can try below suggestions:

1st: Try use the URLDownloadToFile API


Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
    Dim lngRetVal As Long
    lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
    If lngRetVal = 0 Then DownloadFile = True
End Function

Private Sub Form_Load()
    rndkey = Int(Rnd * 100000")
    URL = "" & "&rndkey=" & rndkey
    DownloadFile URL , "c:\test.txt"
End Sub


Ensuring URLDownloadToFile Bypasses a Cached File Copy

2nd: Using M$ Internet Transfer Control ActiveX. You can select it from Components, where it got a method called openURL which do exact the same above to retrive data from an URL.


mydata = Inet1.OpenURL(url)

and then we can display the web page content into textbox, and save into database, etc.

Hope this helps
Ryan ChongCommented:
See this recent PAQ as well : http:Q_21178962.html

where Erick37 suggested solution as follows:

Dim ie As Object
    Set ie = CreateObject("InternetExplorer.Application")
    ie.Navigate ""
    Do While ie.ReadyState <> READYSTATE_COMPLETE
    Debug.Print ie.StatusText
    Debug.Print ie.LocationName
    Debug.Print ie.LocationURL
    Set ie = Nothing
AsifBangashAuthor Commented:
Dear Ryancys,

Thanks for hep me. Your first help is right for me and i m Accepted ur first answer.

ok I do it means capture text from internetexplorer to Textbox of visual Basic 6.0. any way thaks.

like to mail me on my account (asifbangash at
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.