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

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.

Related

VSTO Outlook ItemAdd is not fired on Outlook 365 startup for emails received while Outlook was off

I wrote a VSTO add-in for Outlook. I am in a Microsoft Exchange environment in my company. The add-in responds to new email messages with the ItemAdd event. With Outlook 2013 this worked without problems. Especially when emails were received while Outlook was not started. When Outlook started, an event was fired for each new mail item and everything was fine.
The company has now switched to Office 365.
I have now noticed that Office 365 does not generate any events for newly received emails while Outlook is not running.
As a workaround, I created a rule that moves emails from the default inbox to other folders. I also monitor these other folders for new emails. With this mechanism, I also recognize new emails that have arrived while Outlook was not active.
I don't find this workaround particularly elegant.
The ItemAdd event doesn't seem to trigger events with Outlook 365 for mail (arrived when Outlook is not active) for me when Outlook starts.
Does anyone have any idea how I can create events in Outlook 365 (other than my cumbersome workaround) for emails that came in while Outlook was off?
Items.ItemAdd event won't fire if you are using online mode - the event only fires as Outlook synchronizes its OST cache with the server and newly created messages are downloaded and added to the folder.
Another possibility is that the folder is synchronized before your addin is loaded.
Keep in mind that all Outlook (and MAPI) events were only designed for the UI purposes - they are not guaranteed to fire and can be skipped under heavy loads.
Also note that that if too many items are added/modified/deleted at the same time, folder contents table will fire TABLE_CHANGED or TABLE_RELOAD MAPI event, which (unlike TABLE_ROW_ADDED / TABLE_ROW_DELETED / TABLE_ROW_MODIFIED events mapped to ItemAdd / ItemRemove / ItemChange in OOM correspondingly) is not exposed by Outlook at all. If using Redemption is an option (I am its author), it exposes RDOItems.CollectionModified event (raised when TABLE_CHANGED or TABLE_RELOAD are fired).
Ultimately, if you are using events for any kind of synchronization rather than UI, the events can at best serve as a hint that you need to process the folder sooner rather than later. Each time you process an item, you can store the latest item creation/modification time, then on startup, retrieve all items newer than that time stamp using Items.Restrict or Items.Find/FindNext. Keep in mind that all date/time values in OOM (but not in MAPI or Redemption) are rounded to a minute, seconds and milliseconds are always 0.

Outlook replyall to appointmentitem

I am writing a script to reply to AppointmentItem in outlook. The AppointmentItem does not expose ReplyAll (or Reply) method, and that is only available for MeetingItems. However, all the events on a user's calendar are stored as AppointmentItem class, even if there are multiple attendees. I am wondering how I can ReplyAll to an AppointmentItem? Is there any way to get the associated MeetingItem?
PS: When I right click on an AppointmentItem in Calendar it does enable ReplyAll, so there should be a way to do this.
Currently, this API/feature is not a part of the product. We track Outlook add-in feature requests on our Tech Community Page. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered, when we go through our planning process.

Dismissing Outlook reminders triggers MS Graph API event change notification and ChangeKey change, any way to avoid?

My app keeps track of users' calendar events via Microsoft Graph API. My database records each synced event's ChangeKey, which helps my app determine whether a event has changed and should be processed by business logic.
I also subscribe to the change notification API so that my app doesn't have to poll often.
What I found out lately is that whenever the user dismisses an event's "reminder" via Outlook (via the Outlook reminder popup), which is a very common thing to do as Outlook puts all calendar events on reminders automatically, the Graph API would send out change notification on that event.
That would have been fine – except that the event's ChangeKey actually changes, even though nothing material about the event has changed (date times/subject/body etc). Since my app uses the ChangeKey property to compare events, the business logic triggers unnecessarily.
Is this normal behavior and doesn't that nullify the practical purpose of ChangeKey? Is there any workaround other than giving up the use of this property, and instead manually check for the equality of each meaningful field for event equality?

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 item to webDAV location

I have a web application which has a calendar, and I want to allow that calendar to be sync'd with an Exchange server.
I've written code to create appointments on an Exchange server directly in a user's calendar using webDAV. I save the appointment locations (URLs) so I can update the appointments in outlook if something changes in my application.
I'm trying to write an add-in for Outlook that lets a user send their appointment to my web application. In order to save it though (and allow updates in my application to propagate back to Exchange) I need to figure out what the appointment location (URL) is in WebDAV.
Is there any way to get the WebDAV URL of the appointment from within Outlook? I'm using VSTO for my outlook add-in.
Thanks for the help guys!
This question helped considerably:
How to use WebDav to match dav:href to Outolook Interop href value
And this website was interesting too:
http://www.infinitec.de/post/2007/03/Constructing-OWA-2007-item-ids-from-WebDAV-items.aspx

Resources