Generating an iCal (.ics) file from a SharePoint Calendar List Item

Posted by & filed under , , .

Here’s the quick tip around generating an iCal file for an item in a SharePoint Calender List. You can generate it using the owssvr.dll with a link structured in the following fashion:

http://<SITE_URL>/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List={<LIST_GUID>}&CacheControl=1&ID=<ITEM_ID>&Using=event.ics
  • <SITE_URL> = The URL of the site that hosts the Calendar List you’re referencing
  • <LIST_GUID> = The GUID of the Calendar List you’re referencing
    • Note: This can be found by browsing to the page of the Calendar List you’re referencing and searching the source for ctx.listName. Alternatively, you can just use the dev tools console to check the value of ctx.listName
  • <ITEM_ID> = The ID of the List Item
    • Note: This can be either a simple ID number, like “5”, or for recurring items, it can be a more complex string that tells it which instance of the recurrence to generate an iCal for, like “1.0.2013-06-28T19:00:00Z”

This works in SharePoint 2013 and 2010, and I believe it should work in 2007 as well.

UPDATE:
I found another useful tip, using a modified version of the above structure you can create a calculated column that will allow you to make a convenient iCal link for each item in your Calendar. Create a calculated column in your Calender List that uses this formula:

=”http://<SITE_URL>/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List={<LIST_GUID>}&CacheControl=1&ID=”&ID&”&Using=event.ics”

In this version, you only need to insert the <SITE_URL> and <LIST_GUID> values, because the Item ID is supplied by the formula.