M
MeAgin
Hi all,
How to handle the Open event of a mail item in VB.NET?
I want to display a message when a mail item is opened.
I achieved this in VBA using the Inspector_Activate() event. But when I
write the same code using VB.NET for my add-in it doesn't work.
Following is the code used,
Imports System.IO
Public Class ThisApplication
Public WithEvents VBAInspectors As Outlook.Inspectors
Public WithEvents VBAInspector As Outlook.Inspector
Private Sub ThisApplication_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
VBAInspectors = Me.Inspectors
End Sub
Private Sub ThisApplication_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown
End Sub
Private Sub VBAInspector_Activate()
MessageBox.Show("Opening a mail...")
End Sub
Private Sub VBAInspectors_NewInspector(ByVal Inspector As
Outlook.Inspector)
VBAInspector = Inspector
End Sub
End Class
Any help is appreciated,
Nadee
How to handle the Open event of a mail item in VB.NET?
I want to display a message when a mail item is opened.
I achieved this in VBA using the Inspector_Activate() event. But when I
write the same code using VB.NET for my add-in it doesn't work.
Following is the code used,
Imports System.IO
Public Class ThisApplication
Public WithEvents VBAInspectors As Outlook.Inspectors
Public WithEvents VBAInspector As Outlook.Inspector
Private Sub ThisApplication_Startup(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Startup
VBAInspectors = Me.Inspectors
End Sub
Private Sub ThisApplication_Shutdown(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Shutdown
End Sub
Private Sub VBAInspector_Activate()
MessageBox.Show("Opening a mail...")
End Sub
Private Sub VBAInspectors_NewInspector(ByVal Inspector As
Outlook.Inspector)
VBAInspector = Inspector
End Sub
End Class
Any help is appreciated,
Nadee