VSTO Outlook AddIn: How to handle event when AppointmentItem.Body changes - vsto

I tried to catch the event when the AppointmentItem.Body changes. Handling the PropertyChange on the AppointmentItem does not get called when I type in text or save the AppointmentItem. It gets called when I hit the button "Add Participants though".
Best would be to get the Keydown on the body editor?

The Outlook object model may not propagate changes made in the Outlook UI until you switch focus to another field and/or save the item. This is a well-known issue when dealing with the Outlook object model.

Related

VSTO:Prevent specific AppointmentItems to be converted to recurring AppointmentItems

I am trying to build a Outlook AddIn. In certain cases I want to know whether the user is trying to convert the current AppointmentItem to a recurring AppointmentItem.
Is it possible to catch this event? Is it possible to prevent the event from happening in certain cases?
thanks
You can catch the AppointmentItem.PropertyChange("IsRecurring") event - it will fire whenever the recurrence pattern is changed. You can then prompt the user and call AppointmentItem.ClearRecurencePattern().
AppointmentItem can be retrieved from Inspector.CurrentItem, and inspector can be retrieved from the Inspectors.NewInspector event.

Calling saveAsync from Outlook add-in returns warning notification for an event

My Outlook add-in has a compose scenario for an event (extension point : AppointmentOrganizerCommandSurface). The add-in loads the itemId, makes a REST call to the API to get relevant datas from it and save some calculated datas in the CustomProperties field of the item.
The code ends with Office.context.mailbox.item.saveAsync();
Nevertheless, trying to close the event throws a pop-up asking if the user wants to save changes or not.
How could that be since the last executed code is a saveAsync method on the item ?
Edit : the pop-up occurs only using outlook.office.com but doesn't appear on Outlook dekstop.

How to capture the tick event of the task checkbox on 'Outlook Today'? VSTO Add-in

I'm developing an Outlook Add-in, and currently I have no idea on how to capture the task's checkbox (mark complete) tick event -- particularly on the 'Outlook Today' view. I'd like to override it with my own function.
Refer to the attached image as reference to the checkbox being referred to.
Outlook Today Task
The Outlook Today page is not a typical area that can be integrated with. It is possible though, as it is basically an .html page; see: https://technet.microsoft.com/library/cc750169.aspx. However, this is 20 year-old technology...
If you are mainly interested in trapping changes to that task, then you can trap the Items.ItemAdd event for the Tasks folder and do whatever you like with the modified Task.
The Outlook object model doesn't provide anything for the Outlook Today page. It just lists items from your folders. So, you may consider handling the following events to get the job done:
The ItemChange event of the Items class which is fired when an item in the specified collection is changed.
The PropertyChange event of Outlook items which is fired when an explicit built-in property of an object is changed.
Both events are fired when you mark the task as completed. But in case of the PropertyChange event you need to subscribe to each task item individually which is not really convenient.

Communicating with Outlook 2013 add-in (Skype for Business)

I have a task involving Outlook 2013 and the Skype for Business add-in (formerly known as Lync).
The add-in has a button which changes an appointment into a "Skype meeting".
Pic of button
Upon clicking this button, the following is added to the email body.Pic of default text
My goal is to change this default text (it isn't editable anywhere else). The way I planned to do this is by creating a macro to call the same function which the "Skype Meeting" button does, and then edit the body of the message after the default meeting text has been placed.
I checked for the "name" of the button via the 'Customize the ribbon' window, and within the 'Skype Meeting' group the 3 buttons had the same description (Macro: OnUCAppointmentOnAction)
Using VBA's object explorer I found the details of the method OnUCAppointmentOnAction:
Sub OnUCAppointmentOnAction(asIRibbonControlPtr As Object)
Member of UCAddinLib.UCAddinCallbackInterface
method OnUCAppointmentOnAction
I have added the library reference within VBA to UCaddin.dll (it's called Office Communicator W14 Type Library), yet when I try to call the macro OnUCAppointmentOnAction I get the error "Sub or Function not defined"
Where am I going wrong? Is there is a better way?
Don't do that. That method is implemented by the COM object implementing the IDTExtensibility2 interface that Outlook creates on startup when it loads the addin. In theory, you can do the same, but nobody known what will happen if there are two instances of the addin object instantiated. Simulate a click on the button, then edit the appointment body.

Events not triggering when using Send To (Mail Recipient)

I have an Outlook VBA form, which (on the initialize event) loads various data into menus.
This works in normal usage, however, if you right click, send to (mail recipient) on a file or Send > Email in Word, when you click the button to load the form, the form displays but nothing in any events trigger either on the form load, or on the various click events.
Can anyone offer an explanation of why and how to work around the issue?
You need to handle the NewInspector event of the Inspectors class.
Outlook inspectors shown using Simple MAPI or mailto link do not fire inspector events. This was done on purpose.
Which particular event are you using?