11

I'm working on "Add to Calendar" feature from my Sharepoint webpart (created using VS2010).

I have exported the ICS file programatically with no issues.

But the problem is when I try to open the ICS file from OUTLOOK.

If the ICS file has single appointment, no issues....

If the ICS file has multiple appointments, the problem comes...

When I do File >> Open >> Import >> Choose ics file, it works fine

But If I try to just double click the ICS file, it creates a NEW calendar instead of updating my existing default calendar

Any suggestions...?

tshepang
  • 12,111
  • 21
  • 91
  • 136
user1199808
  • 185
  • 2
  • 3
  • 14

4 Answers4

22

We had a similar problem and found that if the ICS file had the X-WR-CALNAME field in it, even if is was blank, then Outlook would automatically create a new calendar. If it did NOT have this field in it, then Outlook imported it.

LittleBobbyTables - Au Revoir
  • 32,008
  • 25
  • 109
  • 114
Rob Stoecklein
  • 749
  • 6
  • 9
5

I had the same problem. When clicking on a .ics file outlook creates a new calendar rather then updating a existing calendar.

I solved this by adding this descriptor in the .ics file:

X-WR-RELCALID:XXXXXX

where XXXXXX is a unique value for the calendar. Outlook will then ask you for replacing the calendar, rather than adding a new.

The descriptor was found on http://en.wikipedia.org/wiki/ICalendar

ollo
  • 24,797
  • 14
  • 106
  • 155
  • 1
    X-WR-RELCALID:XXXXXX - this should be the answer to the question (and a few other related ones). By adding this line to my ics file the entire calendar gets updated (after a prompt in Outlook). You don't even need to change the DTSTAMP or SEQUENCE or ORGANIZER and METHOD:PUBLISH is fine for the update. Just update the event details and the calendar will update. Note that also works fine if you have published the calendar and provided a URL for people to view it. They just need to hit refresh after about 2minutes and they will also get the update. – Mark Plumpton Jun 21 '16 at 23:32
  • 1
    where can I find the id of the calendar in order to replace XXXXXX? tnx – masciugo May 26 '17 at 10:22
  • No one answered @masciugo question - If you wanted to use the X-WR-RELCALID do you need to know the calendar id? – camelBack Aug 27 '19 at 23:26
4

See this SO post which suggests that Outlook will only support multiple events using ICS as a feed or subscription - not directly as a single ICS import.

Community
  • 1
  • 1
SliverNinja - MSFT
  • 31,051
  • 11
  • 110
  • 173
  • You need to implement the workarounds - script each calendar event into separate ICS files or use an ICS subscription feed. This is a limitation of Outlooks' support for ICS with multiple events. – SliverNinja - MSFT Feb 09 '12 at 20:41
  • can you give me an example? im using http header response to export the ics file. it supports to import the file only once... HEre is my sample code.. private void WriteCalendar(String data) { HttpResponse resp = Page.Response; res.Clear(); res.Buffer = true; res.ContentType = "text/calendar"; res.ContentEncoding = Encoding.UTF8; res.Charset = "utf-8"; res.AddHeader("Content-Disposition", "attachment;filename=\"Events.ics\""); res.Write(data); res.End(); } – user1199808 Feb 10 '12 at 14:25
  • @user1199808 - you should mark this answer as correct and open a new question for your new topic. You need a new post to get others with expertise in internet calendars. – SliverNinja - MSFT Feb 10 '12 at 15:38
  • No problem! Glad to help you out. Good luck with your calendar integration. – SliverNinja - MSFT Feb 10 '12 at 16:48
1

I added this to the VCALENDAR part of my ICS File: "X-MS-OLK-FORCEINSPECTOROPEN:TRUE" This worked for me!

miked
  • 21
  • 2
  • This is exactly what I needed! Thanks! – user1015214 Jun 25 '20 at 19:09
  • This is not the answer. It forces the calendar to recognize only one event. The purpose of this original issue is to support multiple events. https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcical/d2a0a079-02a6-4643-9e78-0ac35998e1fb – Jason Perrone Apr 14 '21 at 13:21