1

I need to create an outlook add-in where appointments will trigger some functionality. For example when an appointment starts I will make a HTTP post request to a server from my outlook addin.

Anyways these appointments need to be synchronized. That is if one user creates an appointment I will like the other outlooks to also create the same appointment. To do so I thought about this:

private void ThisAddIn_Startup(object sender, System.EventArgs e)
{                               
    Microsoft.Office.Interop.Outlook.Application outlookApp = Globals.ThisAddIn.Application;

    // get primary calendar           
    MAPIFolder temp =  outlookApp.Session.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);

    // raise an event when a new appointment is created 
    temp.Items.ItemAdd += Items_ItemAdd;
}

void Items_ItemAdd(object Item)
{
    // serialize this new appointment and send it to the other outlooks
}

With this approach I am basically subscribing to events when an appointment is being deleted, modified or created and propagating those changes on the other outlooks I don't think this will be the best way of sharing a calendar and I feel like I am reinventing the wheel. The reason why I want to take this approach is because I do not know how to share a calendar from within my outlook addin.

Tono Nam
  • 34,064
  • 78
  • 298
  • 470
  • Why not use iCal URLS? Then its always up todate. – Matt Jun 17 '14 at 16:16
  • iCal URLS are readonly? if I create a new appointment will it add it to the iCal? If I create a new appointment will that change be reflected on the other outlooks? – Tono Nam Jun 17 '14 at 17:03
  • No whatever add in that creates the appointment writes to a shared database, use that database to generate your iCal feed. Everytime the users open their shared iCal calendar it will get refreshed with the latest data from the database. – Matt Jun 17 '14 at 17:18
  • iCal URLs are not necessarily read/write - they would only have this functionality if running on a [CalDAV server](http://en.wikipedia.org/wiki/CalDAV). – madebydavid Jun 23 '14 at 16:09

1 Answers1

1

Check out this answer. How to detect which EKevent was changed With the notification, you can check inside your add-in to see when an event has been changed in iCal, then from there send your update/delete HTTP request to the outlook server to reflect changes made.

In your HTTP request use "SendToAllAndSaveCopy"

Community
  • 1
  • 1
Rasputin
  • 487
  • 4
  • 10