Does anyone know how to get the current URL that Internet Explorer is at into a VB program? I want to be able at any time have the URL transfered to my program.
I have looked everywhere, please help..
Printable View
Does anyone know how to get the current URL that Internet Explorer is at into a VB program? I want to be able at any time have the URL transfered to my program.
I have looked everywhere, please help..
Try this:
Start a new standard EXE project and add a CommandButton to the default form.
Click on Project|References and check the Microsoft Internet Controls checkbox.
Then add the following code:
When you run this project a new Internet Explorer window is opened. When you click the CommandButton a MsgBox is popped up showing the location.Code:Private ie As InternetExplorer
Private Sub Form_Load()
'start IE
Set ie = New
ie.Visible = True
ie.GoHome
End Sub
Private Sub Command1_Click()
MsgBox ie.LocationURL
End Sub
Good luck!
NEED MORE>>>
I used what you said Joacim, but all that it does is start IE and gives me the address at start up. What I need is at any given time, I be able to get the address from IE, not just at one instance.
Please continue responses, need help!!
Someone has got to know...
I will add more to help clarify...
I am designing a program so when I am surfing the web and I am at a web site that I want to get links from, and store in a file, I just push a button and the program will get the address from IE and then go off on its own and get the HTML, parse out the links and store them in a list box.
This is why I need the current IE's address.
http://forums.vb-world.net/showthrea...threadid=25452
I posted this a little while ago, it should help you do what you want