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

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.

Related

Custom appointment form is different when opening appointment

I have made a custom form region for my appointments in outlook - Which I really would like to use.
However, I have a problem with implementing it in my outlook.
When I want to schedule a new appointment, it opens up the correct form that I want to use - and works without any issues.
However, the problem occurs when I want to open and see my appointment. Here, it shows some previous published version - Which of cause does not properly work.
Things I have tried
I don't remember, that I at any time specified a default form to use upon opening an appointment. But the way it acts, it seems like I did.
I have tried deleting and republish my form with a different name
I have tried specifying "When posting to this folder, use" for my calendar
Still, it keeps opening already scheduled appointments with a completely different form, that I made several days ago.
Every Outlook item has the class name set, so that is how Outlook knows which form should be used to display the item. See Associate a form region with an Outlook message class for more information.
Also, you may take a look at the Assign a custom form to existing Outlook items article.

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

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.

Handling save event in Outlook

Good morning, I need my VBA code to run right before the TaskItem is saved, is there any way I can handle the event of saving ? I cannot find anything I could use in documentation. I am using MS-Office 2010.
Edit: I have tried
Private Sub TaskItem_Quit()
The macro disappears from macro list, but the code still does not run.
Try the Write event.
https://msdn.microsoft.com/en-us/library/office/ff868664.aspx
"Occurs when an instance of the parent object is saved, either explicitly (for example, using the Save or SaveAs methods) or implicitly (for example, in response to a prompt when closing the item's inspector)."

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.

Event in outlook application object model to know when the first click happens on message body box?

I am developing a add-in to perform some actions when the first click happens on the message box in outlook (2013 version). I want to capture the Outlook.MailItem.Recipients as soon as the first click happens on message body box.
Possible approach to do this (just did a quick test, seems to work for 2013):
Register to NewInspector event of the Application object:
Application.Inspectors.NewInspector += ....;
In the event handler, register to the following event:
var editor = newInspector.WordEditor as Word.Document;
editor.Application.WindowSelectionChange += ....;
The handler fires when the selection changes, which is also happening when the user clicks the window.
Please note that you must keep references to all objects in this sample, else the event registrations will get lost.