1
votes

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.

1
Why not use iCal URLS? Then its always up todate.Matt
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
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
iCal URLs are not necessarily read/write - they would only have this functionality if running on a CalDAV server.madebydavid

1 Answers

1
votes

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"