1

Is there a way we can hook into an outlook appointment form and run some validation logic prior to "Send".

For e.g. our business requirements are somewhat like this.

  1. Populate your meeting request by some means. We have some addin feature that does this.
  2. Click on Send. Normally this should actually "send" the email. Instead of this, I need to validate with respect to another service, and post successful validation I should allow the "send" else cancel it.

How do I do this in outlook addin?

deostroll
  • 11,661
  • 21
  • 90
  • 161

1 Answers1

0

It looks like you are interested in the ItemSend event of the Application class. It is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before the inspector is closed, but after the user clicks the Send button) or when the Send method for an Outlook item, such as MailItem, is used in a program.

Also the AppointmentItem class provides the Send event which is fired when the user selects the Send action for an item, or when the Send method is called for the item, which is an instance of the parent object.

Here is how to hook to the event from the AppointmentItem

Outlook.ItemEvents_Event _apptEvents = (Outlook.ItemEvents_Event)ai;
_apptEvents.Send 
    += new Outlook.ItemEvents_SendEventHandler(_itemClass_ItemEvents_Event_Send);
deostroll
  • 11,661
  • 21
  • 90
  • 161
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • `Outlook.ItemEvents_Event _apptEvents = (Outlook.ItemEvents_Event)ai;_apptEvents.Send += new Outlook.ItemEvents_SendEventHandler(_itemClass_ItemEvents_Event_Send);` – Eugene Astafiev Jul 06 '15 at 15:44
  • You can remove the previous comment. I've added that to your answer. But why doesn't this interface not show up in VS? – deostroll Jul 07 '15 at 06:14