Download ICS files from SharePoint calendars

The other day while playing with SharePoint modern Events web part with my colleague Francisca Peixoto we realized that it includes a feature to download an ICS file to then be added to an Outlook calendar.

This discovery also reminded me that I once started a project to provide this exact same functionality on classic SharePoint calendars but never finished it.

After spending a while searching for the code I finally found it, finished the project and I’m sharing it with all of you guys in this article.

Download ICS file from SharePoint calendar event manually

SharePoint has the possibility to generate ICS files from calendars since SharePoint 2007, however it never had this functionality available through the graphical user interface.

They only way to get the file is by using a structured URL in the following format.

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

  • SITE_URL – The URL to the site where the calendar is hosted
  • LIST_GUID – The unique identifier of your calendar list
  • EVENT_ID – The identifier of the calendar event

Getting the LIST_GUID and the EVENT_ID is not straight forward for most users and with that in mind I decided to build a custom solution that adds a small download button on top of each event when the user hovers it. It also adds an extra field to the event detail with a direct link to the ICS file.

How to install the solution

This solution is provided as declarative Sand Box solution (read more about this type of solutions here) and it works on SharePoint 2013 and 2016 On Premises and SharePoint Online classic sites, this solution will not work on modern sites.

If you are using SharePoint Online to accomplish the steps bellow you will need to enable the custom scripts on your tenant, here you have the instructions on how to do it.

  1. Download the solution from here
  2. Extract it from the ZIP file
  3. On the root site of your site collection go to Settings Site Settings Solutions
  4. Upload and Activate the Solution

Once the activation process finishes the solution is ready to be used by all calendars of the site collection.

How to use the solution

To use this solution, you just need to open the calendar and over the item as exemplified in the animation below.

This solution supports the following views:

  • Monthly view
  • Weekly view
  • Daily view
  • Event detail view

How the solution works

The solution deploys a custom action on your site collection, it validates if you are visiting a SharePoint calendar and if you are it automatically gets the LIST_GUID and the EVENT_ID to build the link to download the ICS file.

As always, I made the solution available on GitHub and you are welcomed to contribute to improve it, due to the fact I lost the Visual Studio Project I’m sharing just the WSP files. Instructions on how to modify the solution will be provided in the repository.

Thanks to Justin Shands for the great article Generating an ICAL (.ICS) file from a SharePoint calendar list item, it was fundamental to build this solution.

Download ICS Solution
Explore Solution on GitHub

Designed by Freepik


2 Responses to “Download ICS files from SharePoint calendars”

  1. Brett

    August 21, 2018

    Just uploaded this to my SP2013 site collection and there’s only a single button in the ribbon called “Custom Commands” with a button is called “Export Event”, which works perfect when clicked.
    There’s no button image on the Calendar item and no “Add to Calendar” field on the Display Form.
    Is that correct for SP2013?

    Reply
    • João Ferreira

      August 23, 2018

      Hi Brett,

      Thanks for reporting the issue, in fact there was an issue with the previous version of this solution.
      I’ve made a new version that you can download from the artile.
      To update to the latest version do the following:
      1 – Go to Site Settings -> Solutions
      2 – Deactivate the existent version
      3- Upload and activate the new version

      Let me know if it works for you.

      Reply

Leave a Reply


Web developer focused on SharePoint branding, blogger, tech enthusiast. Travelling and sports are my addictions, knowledge and success are my daily motivations.