views:

2818

answers:

7

I'm generating ICalendar (.ics) files.

Using the UID and SEQUENCE fields I can update existing events in Google Calendar and in Windows Calendar BUT NOT in MS Outlook 2007 - it just creates a second event

How do I get them to work for Outlook ?

Thanks

Tom

A: 

Does it validate? If so, can you post an example?

Hank Gay
A: 

Yes the original and update both validate (thanks for the link)

Original:

BEGIN:VCALENDAR  
VERSION:2.0  
PRODID:-//SYFADIS//PORTAIL FORMATION//FR  
BEGIN:VEVENT  
UID:d27863f0-0733-423f-aa7b-ad52e256aa37  
DTSTART:20080906T120000  
DTEND:20080906T140000  
SUMMARY:Test Event Original begins at midday for 2 hours  
STATUS:CONFIRMED  
END:VEVENT  
END:VCALENDAR

Update:

BEGIN:VCALENDAR  
VERSION:2.0  
PRODID:-//SYFADIS//PORTAIL FORMATION//FR  
BEGIN:VEVENT  
UID:d27863f0-0733-423f-aa7b-ad52e256aa37  
DTSTART:20080906T150000  
DTEND:20080906T200000  
SUMMARY:Test Event New Version - moved by 3 hours  
STATUS:CONFIRMED  
SEQUENCE:1  
END:VEVENT  
END:VCALENDAR
Tom Carter
A: 

I'm using Entourage, so this may not match up exactly with the behavior you're seeing, but I hope it helps.

Using the iCalendar from your reply, Entourage wouldn't even import the data. Using a known-good file, I got it to import, then successfully update. Comparing the two files, the only structural differences are as follows:

  • My known-good doesn't have a VERSION element
  • My known-good doesn't have a PRODID element
  • My known-good doesn't have a STATUS element
  • My known-good doesn't have a SEQUENCE element

Since Microsoft's support for open standards tends to lag, I'd suggest trying without the VERSION info.

Hank Gay
+3  A: 

I've continued to do some testing and have now managed to get Outlook to update and cancel events based on the .cs file.

Outlook in fact seems to respond to the rules defined in RFC 2446

In summary you have to specify

METHOD:REQUEST and ORGANIZER:xxxxxxxx

in addition to UID: and SEQUENCE:

For a cancellation you have to specify METHOD:CANCEL

Request/Update Example

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//SYFADIS//PORTAIL FORMATION//FR
METHOD:REQUEST
BEGIN:VEVENT
UID:[email protected]
SEQUENCE:5
DTSTAMP:20081106T154911Z
ORGANIZER:[email protected]
DTSTART:20081113T164907
DTEND:20081115T170000
SUMMARY:TestTraining
STATUS:CONFIRMED
END:VEVENT
END:VCALENDAR

Cancel Example;

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//SYFADIS//PORTAIL FORMATION//FR
METHOD:CANCEL
BEGIN:VEVENT
UID:[email protected]
SEQUENCE:7
DTSTAMP:20081106T154916Z
ORGANIZER:[email protected]
DTSTART:20081113T164907
SUMMARY:TestTraining
STATUS:CANCELLED
END:VEVENT
END:VCALENDAR
Tom Carter
I'm going to run into the same situation shortly. This saved me time I guess. :-D Thanks!
Tomalak
I found out (the hard way) that this will not work in Apple iCal unless you specify an attendee (inside the VEVENT block), the same in both events: *** ATTENDEE;CN="John Doe";PARTSTAT=ACCEPTED:mailt o:[email protected] *** Without it, iCal does nothing. With it, it crosses out the event and gives the option to delete it.
Ölbaum
+2  A: 

I got a hold of Tom Carter, the asker. He had a working example with a request followed by a cancellation. What I had wrong was my METHOD was inside my VEVENT when it should have been outside. So here is a working update!

Original:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//WA//FRWEB//EN
METHOD:REQUEST
BEGIN:VEVENT
UID:FRICAL201
SEQUENCE:0
DTSTAMP:20081108T151809Z
ORGANIZER:[email protected]
DTSTART:20081109T121200
SUMMARY:11/9/2008 12:12:00 PM TRIP FROM JFK AIRPORT (JFK)
LOCATION:JFK AIRPORT (JFK)
END:VEVENT
END:VCALENDAR

Update:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//WA//FRWEB//EN
METHOD:REQUEST
BEGIN:VEVENT
UID:FRICAL201
SEQUENCE:1
DTSTAMP:20081108T161809Z
ORGANIZER:[email protected]
DTSTART:20081109T121300
SUMMARY:11/9/2008 12:13:00 PM TRIP FROM JFK AIRPORT (JFK)
LOCATION:JFK AIRPORT (JFK)
END:VEVENT
END:VCALENDAR

All I did was add the request method (in the correct spot!), and an organizer.

Chris
Original and Update do not differ significantly. Copy/paste error?
Tomalak
The DTSTART time is different. The key is just having all the right stuff in all the right order in each one. They end up looking almost the same.
Chris
A: 

Have you tried canceling multiple events by importing an iCalendar file?

dev.e.loper
+1  A: 

I am using outlook 2003 (from reading the posts, 2007 appears to behave in the same way) and you need to clearly distinguish between the behaviour of the explicit file import of an ics file and the implicit import when an ics file is 'double clicked'.

On the Outlook menu File / Import and Export ... Outlook will load as many VEVENT entries as are in the file and no amount of changing UID:, SEQUENCE: or DTSTAMP: values changes this, i.e.if you change any data and re-import it you just get a duplicate set of entries.

If you double click on an ics file it processes the first VEVENT entry only. However it does recognise the UID and, if the DTSTAMP: is later (the SEQUENCE can be the same but not lower) you will be prompted and it will update the event in your calendar.

BEGIN:VCALENDAR
VERSION:2.0
PRODID:www.membership-services.net
METHOD:REQUEST
BEGIN:VEVENT
DTSTART:20090126T210000
DTEND:20090126T220000
SUMMARY:Avondale - Thameside Away Game vs Croydon
LOCATION:Whitgift School
DESCRIPTION:http://maps.google.co.uk/maps?f=q&hl=en&geocode=&q=CR2+6YT 
UID:AWPC_8
SEQUENCE:0
DTSTAMP:20090123T112600
END:VEVENT
BEGIN:VEVENT
DTSTART:20090202T213000
DTEND:20090202T223000
SUMMARY:Avondale - Thameside Home Game vs Orcas
LOCATION:Putney
DESCRIPTION:http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&ie=UTF8&ll=51.4635,-0.2285&spn=0.005,0.009613&t=h&z=17&iwloc=lyrftr:w2t.90,0x48760f04a04b1801:0x49ebf12503a5d5a9,51.463459,-0.228674 
UID:AWPC_10
SEQUENCE:0
DTSTAMP:20090123T112600
END:VEVENT
END:VCALENDAR
I experienced the same behavior. For Outlook 2003 (haven't test 2007 yet), these are the minimum requirements to update an event: (a) single event in ics (b) METHOD must be REQUEST (c) UID must be equal (d) SEQUENCE must be present, and >= the previous sequence number (e) import into outlook by double-clicking the event
Alexander Klimetschek