With .ics files can I delete old events?
Asked Answered
U

1

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.

Unseam answered 14/10, 2009 at 14:26 Comment(2)
possible duplicate: #357098Helpful
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.Unseam
M
20

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:[email protected]
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:[email protected]
SUMMARY:Eine Kurzinfo
DESCRIPTION:Beschreibung des Termines
CLASS:PUBLIC
TRANSP:TRANSPARENT
DTSTART:20110804
DTEND:20110805
DTSTAMP:20110804
STATUS:CANCELLED
END:VEVENT
END:VCALENDAR
Meatball answered 4/8, 2011 at 12:6 Comment(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.Minnaminnaminnie
@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.Equestrian
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.icsLepage

© 2022 - 2024 — McMap. All rights reserved.