Home > Software engineering >  Vb how pop-up msgbox before Internet explorer onquit event?
Vb how pop-up msgbox before Internet explorer onquit event?

Time:12-22

Hello, I try to use VB to control Internet explorer, at present has achieved start IE, and visit a url (e.g., baidu), plans to close the IE, pop up a dialog box please confirm user, way of thinking is done by onquit event

But has not been goal effect, directly closed but there is no pop-up msgbox

The main code is as follows:
 Sub main () 
Dim x As New Class1
X.N avigate "www.baidu.com"
End Sub


Class module code is as follows:
 Dim WithEvents ie As SHDocVw. InternetExplorer 

Public Sub Navigate (ByVal txtAddress As String)
On the Error Resume Next
If ie="" Then
The Set ie=GetObject (" ", "InternetExplorer. Application")
End the If
Ie. Visible=True
Ie. Navigate2 txtAddress
'ie. TheaterMode=True
'ie. FullScreen=False
', ie ToolBar=False
'ie. The MenuBar=False
'ie. The StatusBar=False
'ie. The Resizable=False
End Sub

Public Sub ie_OnQuit ()
MsgBox 111
End Sub


Give advice or comments, thank you!

CodePudding user response:

Sincere help,,, there must be something wrong in where
  •  Tags:  
  • API
  • Related