Discussion Locked

VB Programming Problemm

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have an application designed in Visual Basic 6. I need d same app to wake up and run Internet Explorer 5 even close it after some input time. And if the IE5 was closed by the user then print msg on screen. SO, I NEED SOME INSTRUCTION(CODE) THAT CAN HELP ME TO DO THIS IN VB6

4 replies

by zhangyinping

First, you need set a reference of the Microsoft internet controls.
Then add the following code to your project

Dim WithEvents IE5 As InternetExplorer

add the following code to the procedure which you want it to wake up the IE.

Set IE5 = New InternetExplorer
IE5.Visible = True
IE5.Navigate "The URL you want IE to go"

This will open the IE. If you want to close it. add the following code to the procedure

IE5.Quit
Set IE5 = Nothing

If IE5 is closed by the user, put some code to the IE5 onquit event procedure. like this:

Private Sub IE5_OnQuit()
Msgbox "Donot close IE"
End Sub

Use Object Browser the check out the Object Model of the Internet Explore object.

If you need any more info, please email me.

ZYP, MCSD

This discussion is closed to new replies.