R
Roger
I am creating an application that will sit on a client pc and monitor the
inbox. When an e-mail enters the inbox, then an even will be fired and I
will then be able to process the mail.
I have the following code that does fire the eventhandlerNewMail,
but I don't know how to do the following 2 things...
1. Get the NewMail object so I can look at the mailitems Subject, From
etc...
2. The current Outlook client has access to multiple mailboxes. Is there a
way to know which
mailbox fired the event?
Dim m_Olapp As New Outlook.Application
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AddHandler m_Olapp.NewMail, AddressOf Me.eventhandlerNewMail
End Sub
Public Sub eventhandlerNewMail()
MsgBox("New Mail has arrived")
End Sub
Private Sub Form1_Closed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Closed
RemoveHandler m_Olapp.NewMail, AddressOf Me.eventhandlerNewMail
End Sub
inbox. When an e-mail enters the inbox, then an even will be fired and I
will then be able to process the mail.
I have the following code that does fire the eventhandlerNewMail,
but I don't know how to do the following 2 things...
1. Get the NewMail object so I can look at the mailitems Subject, From
etc...
2. The current Outlook client has access to multiple mailboxes. Is there a
way to know which
mailbox fired the event?
Dim m_Olapp As New Outlook.Application
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
AddHandler m_Olapp.NewMail, AddressOf Me.eventhandlerNewMail
End Sub
Public Sub eventhandlerNewMail()
MsgBox("New Mail has arrived")
End Sub
Private Sub Form1_Closed(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Closed
RemoveHandler m_Olapp.NewMail, AddressOf Me.eventhandlerNewMail
End Sub