S
sophie
hi,
I want to code a small project which can pop up a warning when user click
send a email.
But it doesnt work for application_itemsend.
i work with VS2008, vb.
the code is here.
Public Class ThisAddIn
Public WithEvents myOlApp As Outlook.Application
Event ItemSend As AssemblyLoadEventHandler
Public Sub Initialize_handler()
myOlApp = CreateObject("Outlook.Application")
End Sub
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
Initialize_handler()
End Sub
Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown
End Sub
Private Sub myOlAppEvents_ItemSend(ByVal Item As Object, ByVal Cancel As
Boolean)
Dim prompt As String
prompt = "Are you sure you want to send " & Item.Subject & "?"
If MsgBox(prompt, vbYesNo + vbQuestion, "Sample") = vbNo Then
Cancel = True
End If
End Sub
End Class
Any help is appreciated.
I want to code a small project which can pop up a warning when user click
send a email.
But it doesnt work for application_itemsend.
i work with VS2008, vb.
the code is here.
Public Class ThisAddIn
Public WithEvents myOlApp As Outlook.Application
Event ItemSend As AssemblyLoadEventHandler
Public Sub Initialize_handler()
myOlApp = CreateObject("Outlook.Application")
End Sub
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
Initialize_handler()
End Sub
Private Sub ThisAddIn_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown
End Sub
Private Sub myOlAppEvents_ItemSend(ByVal Item As Object, ByVal Cancel As
Boolean)
Dim prompt As String
prompt = "Are you sure you want to send " & Item.Subject & "?"
If MsgBox(prompt, vbYesNo + vbQuestion, "Sample") = vbNo Then
Cancel = True
End If
End Sub
End Class
Any help is appreciated.