tags:

views:

604

answers:

3

I'm creating an ics file using ASP.NET for importing holiday into Outlook 2007 and trying to set the all-day-event flag. This works fine on multi-day holidays, but for single days, it doesn't seem to be registering, I just get a 'singularity holiday' booked from midnight to midnight.

According to MSDN, setting the start and end times to 00:00 should be enough to do this. I've also tried using the X-MICROSOFT-CDO-ALLDAYEVENT and X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT flags, but they don't seem to have any effect.

Can anyone see where I'm going wrong? I've included sample ouput below.

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
CLASS:PUBLIC
DESCRIPTION:HOLIDAY\n
DTEND;VALUE=DATE:20090727
DTSTAMP:20091111T000000Z
DTSTART;VALUE=DATE:20090727
LAST-MODIFIED:20091111T000000Z
PRIORITY:5
SEQUENCE:0
SUMMARY;LANGUAGE=en-gb:HOLIDAY
TRANSP:OPAQUE
X-ALT-DESC;FMTTYPE=text/html:HOLIDAY
X-MICROSOFT-CDO-BUSYSTATUS:OOF
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-DISALLOW-COUNTER:FALSE
X-MS-OLK-ALLOWEXTERNCHECK:TRUE
X-MS-OLK-CONFTYPE:0
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
END:VEVENT
END:VCALENDAR
+1  A: 

found the answer. to make an all day event you need to make the appointment end at midnight the day after.

wefwfwefwe
A: 

The above comment RE: midnight the day after didn't work for me in Apple's iCal. To get around this, in each of the BEGIN:VEVENT sections, I have output the dates as follows:

DTSTART;VALUE=DATE:20100101
DTEND;VALUE=DATE:20100101

I don't know if you still need the Microsoft tags though?!

atomicguava
A: 

Not sure about MSDN, but according to the latest ical spec, a single day all day event starts on 1 day and ends on the next (not midnight which sounds like end of day, but is assumed to be 00:00, ie start of day, similar I suppose)

In the latest spec RFC 5545, if one has no end date or end = start, then it is kinda a anniversary - not a one day all day event.

If your ics files are to be used elsewhere or propogated further, then it is worth trying to get this right.

A note on this here: http://icalevents.anmari.com/1778-all-day-events-adding-a-day-or-not/

anmari