17

Im currently working on an .ics export from our application.

Can I somehow delete old events, so in my first import into outlook I have 152 events and during my second import I only have 100 events. Then I would like the import to automatically delete all 52 events from Outlook, is this possible?

I know that I can make events canceled, but that is not what I want.

Fredrik
  • 2,016
  • 3
  • 15
  • 26
  • possible duplicate: http://stackoverflow.com/questions/356598/delete-calendar-event-using-icalendar-file-import-outlook-2003-problem – Rubens Farias Oct 14 '09 at 14:35
  • Nope, or at least he seems satisified with just setting CANCELED on his event which is not what I want. I want my events completely deleted from the calendar. – Fredrik Oct 14 '09 at 14:42

1 Answers1

19

For me it worked by setting the X-WR-RELCALID tag in the header of the ics file. Then Outlook recognized the event as the same. Also set METHOD:CANCEL in the header and STATUS:CANCELLED in VEVENT. Like this:

This ics to create the event:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:http://www.example.com/example/
X-WR-RELCALID:ABC
METHOD:PUBLISH
BEGIN:VEVENT
UID:ThisIsTheUID
SEQUENCE:0
ORGANIZER;CN="Mustermann, Max":MAILTO:max@mustermann.com
SUMMARY:Eine Kurzinfo
DESCRIPTION:Beschreibung des Termines
CLASS:PUBLIC
TRANSP:TRANSPARENT
DTSTART:20110804
DTEND:20110805
DTSTAMP:20110804
END:VEVENT
END:VCALENDAR

This ics to cancel/remove the event:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:http://www.example.com/example/
X-WR-RELCALID:ABC
METHOD:CANCEL
BEGIN:VEVENT
UID:ThisIsTheUID
SEQUENCE:2
ORGANIZER;CN="Mustermann, Max":MAILTO:max@mustermann.com
SUMMARY:Eine Kurzinfo
DESCRIPTION:Beschreibung des Termines
CLASS:PUBLIC
TRANSP:TRANSPARENT
DTSTART:20110804
DTEND:20110805
DTSTAMP:20110804
STATUS:CANCELLED
END:VEVENT
END:VCALENDAR
Marc
  • 201
  • 2
  • 3
  • 3
    I used the above code for Google Calendar. When i receive ICS file for cancellation, i look into my google calendar and previous event remains there (not deleted). Am i doing something wrong. – Sahil Bhatia May 30 '16 at 15:16
  • @SahilBhatia I am getting the same results you describe. Google Calendar and Yahoo Calendar import the REQUEST file and show the event. Then they import the CANCEL file but keep showing the event. – Rob_M Jun 05 '16 at 21:18
  • Tried this with my ics file and it didn't work... `cat nfl.ics | gsed "/CLASS:PUBLIC/aSTATUS:CANCELLED" | gsed "s/METHOD:PUBLISH/METHOD:CANCEL/g" > nfl_delete.ics` – SomeGuyOnAComputer Oct 18 '18 at 23:20