Office.js - Outlook - saving a unsaved appointment using saveAsync - outlook

In my main compose form in an Outlook add-in written in the new office.js API I want to be able to save a unsaved appointment.
By unsaved I mean that the user double-clicked on the calendar, wrote some data on the subject and didn't clicked "Save" just went straight to my add-in by opening the compose form.
When I call
Office.context.mailbox.item.saveAsync
I'm getting following error displayed for the user:
Error: the event couldn't be created on the server. Please try again.
and a pop-up displays a similar message:
Couldn't create the following event: [EVENT_NAME]
any tips how to save this event?
Above behavior is on Outlook Web App.

Please unselect the All day checkbox on the appointment compose form and then call saveasync, it should work. This happens to be a known issue that we are addressing.
All Day Checkbox on compose appointment

Related

On-send add-in not loading after Outlook error

I am developing an Outlook 'on-send' add-in which loads a dialog box if the email is addressed to multiple recipients after the send button is pressed. In the dialog, the user confirms the intended recipients from a list and then presses send. The add-in then allows the send event to happen.
A problem arises if the emails are not formatted correctly; Outlook throws a ‘does not recognise email’ error after trying to send the email. The problem is that when I try to send the email again after the error, the add-in does not load. The add-in should load every time the user tries to send an email to multiple recipients.
Please see a video of this behaviour here: https://youtu.be/U1VFuy1qbHM
As you can see from the video, the email goes to my Outbox fine after the first send. However, Outlook throws an errors when I edit the email in my Outbox and try to send it again (presumably because I was using a made up email to test with). As you can see, if I then update the emails and click send, the email sends without the add-in loading again. The intended functionality of the add-in is that another dialog box should be displayed in this case.
This behaviour also occurs when you reply to an email where the recipient has their email address formatted differently. For example, 'Name Surname (name.surname#domain.com)' instead of 'Name Surname <name.surname#domain.com>'. Outlook does not seem to like this format and throws a similar error after trying to send the email. After updating the email format and clicking send, the add-in does not load again.
The error occurs in Win32.
I do not think the problem is with the Javascript. I think the add-in does not even load when I try to resend the email. Maybe the add-in is somehow holding onto the ‘True’ value of the on-send event from the previous dialog box? I have tried editing the different ‘ReadorEdit’ values in the Manifest file to try and ensure the add-in loads for all cases but it has not helped.
What can I do to ensure the add-in loads after these errors?
Thank you for your help- it is very much appreciated.

Is it possible to detect when the user changes the date of an appointment directly from the calendar?

I am writing an outlook web Add-In where the user can create an appointment and book a meeting room through the software.
The problem is that once the user closes the Add-In and goes back to the calendar, they can freely change the date of the appointment by dragging it around, and the Add-In cannot see those changes, since it's not open.
That means that those changes do not get registered into the system and are essentially only local to the user who made them. I need a way that I can detect whenever the user changes the date of an appointment, so that I can update the data on my end.
I have heard about subscribing to notifications but I'm not sure that is the best solution. Any Ideas would be highly appreciated.
Not from a web addin - you can do that from a standalone app that continuously runs and uses either the Outlook Object Model (Items.ItemChange event) or EWS to receive the folder notifications. Or you can do that from a COM addin that uses the Items.ItemChange event.

How to send appointment through Outlook add-in?

I'm trying to implement an add-in for Outlook which has some fields and a button that once clicked does some validations and sends an appointment to inform the attendees.
I am using the function below to achieve my goal:
Office.context.mailbox.item.saveAsync()
Office.context.mailbox.item.close() (as a callback for the function above)
It works for office365, but it doesn't work for office365 thick client.
I found in the Microsoft docs that with the function 'saveAsync' in Outlook in cached mode, the item is saved to the local cache. I disabled this option and still getting the same result.
I was using OnSend functionality, but this feature is not supported for Outlook client.
Any advice or tips of how could I have the functionality of sending the appointment through my Add-in in both, client and web version of Outlook? Basically I need to trigger the existing button 'Send' in the calendar.
It sounds like the ItemSend Event (OnSend) you are using in Outlook on the Web handles your scenario. We are working to bring this functionality to Outlook on Windows soon.

Outlook plug-in

I'm looking build an outlook addin that can do the following. Would like to hear tips from anyone who might have done this before.
Upon install, read the person's profile in outlook and call a service which will create an account for that person in my app
When person sends an email from outlook with a .pptx/.ppt file(s) attached, it calls a service to automatically upload that file(s) into my app.
Upon install, read the person's profile in outlook and call a service which will create an account for that person in my app
You can use Namespace.CurrentProfileName property introduced with Outlook 2007.
When person sends an email from outlook with a .pptx/.ppt file(s) attached, it calls a service to automatically upload that file(s) into my app.
The Application.ItemSend event 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. So, in the event handler you can check the Attachments collection for the files specified and do your web calls.
See Walkthrough: Creating Your First VSTO Add-In for Outlook to get started quickly.

Outlook Addin - Wait for a response

I have an Outlook Addin that creates a contact on a webpage by making an API call to that webpage. When the Addin runs (via the click of a button), the API call is made and the user is taken to that webpage to fill in the contact information. After the user has filled in the information and clicks on submit, I would like to catch that event in Outlook and get the user back to Outlook to carry out further actions. Any possible ways of getting this done? I've been looking online but haven't found any solution as such.
Try to display the web page in a modal dialog in your own form. When the form is closed, you can take whatever action is necessary.
You may find the ItemSend event of the Application class helpful. 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 you may consider repurposing ribbon controls. See Temporarily Repurpose Commands on the Office Fluent Ribbon for more information.

Resources