Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

New Post: Accessing Inspector events in OutlookApi

$
0
0
I'm also having this issue, did you find a solution to the New Inspector Event? I was trying to do something like this , but no luck because "Handles inspectors.NewInspector" doesn't find the NewInspector-Event.

//Edit

OK, it's working now, although I have no idea why this didn't work previously. I just have the following (all in Addin.vb:
Shared _outlookApplication As Outlook.Application

Private WithEvents inspectors As Outlook.Inspectors

Public Sub OnStartupComplete(ByRef custom As System.Array) Implements IDTExtensibility2.OnStartupComplete
    SetupGui
    inspectors = _outlookApplication.Inspectors
End Sub

  Private Sub inspectors_NewInspector(ByVal Inspector As Outlook.Inspector) Handles inspectors.NewInspectorEvent
    Dim mailItem As Outlook.MailItem = CType(Inspector.CurrentItem, Outlook.MailItem)
        
  End Sub
I'm sure I had that before, and the compiler complained that it couldn't find the NewInspectorEvent. I'm glad it works now, although I wish I knew why it didn't before.

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>