Peter Hansen
Peter Hansen

Reputation: 81

Outlook 2016 Addin VSTO Catch new calendar event

I have a Add-in for Outlook 2016 and I catch when a new calendar event is created by code:

inspectors = this.Application.Inspectors;
            inspectors.NewInspector +=
            new Microsoft.Office.Interop.Outlook.InspectorsEvents_NewInspectorEventHandler(Inspectors_NewInspector);

This is working fine if the user: 1. Click on [New Appointment] in the ribbon 2. Right click on the calendar and choose [New Appointment] 3. Doubleclick in the calendar

But if the user create a new calendar event by entering a text directly in the calendar the event is not raised.

enter image description here

How do I catch this?

Upvotes: 1

Views: 877

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49455

In that case no Inspector window is created, so you will not trap into the NewInspector event. Instead, you can handle the ItemAdd event of the Items class which is fired when one or more items are added to the specified collection. Note, this event does not run when a large number of items are added to the folder at once.

Upvotes: 2

Related Questions