How do I use IE with VB?
I need to write a browser program with IE functionality, and I want to avoid the Internet control.
Printable View
How do I use IE with VB?
I need to write a browser program with IE functionality, and I want to avoid the Internet control.
Add a reference to Microsoft Internet Controls and then you can use something like this:
There are a lot of stuff you can do. Explore them using the object browser.Code:Private Sub Command1_Click()
Dim i As SHDocVw.InternetExplorer
Set i = New InternetExplorer
i.Visible = True
i.Navigate "http://www.altavista.com"
End Sub
I had tried a similar approach, only the object i was declared as InternetExplorer and not as SHDocVW.InternetExplorer.
The subsequent efforts of creating a new instance of the IE failed, probably because of the declaration.
Thanks for the tip. I shall try it out and let you know if it worked or not.
hi,
try this pease of code get back if any problem
Private Const INTERNET_INVALID_PORT_NUMBER = 0
Private Const INTERNET_OPEN_TYPE_PRECONFIG = 0
Private Const INTERNET_SERVICE_HTTP = 3
lHandle = InternetOpen(App.EXEName, INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
lConnection = InternetConnect(plHandle, http://www.altavista.com, INTERNET_INVALID_PORT_NUMBER, "", "", INTERNET_SERVICE_HTTP, 0, 0)
lRequest = HttpOpenRequest(plConnection, "GET", vbNullString, "HTTP/1.0", "", 0, _
INTERNET_FLAG_RELOAD Or INTERNET_FLAG_KEEP_CONNECTION, 0)