4

I have an .ics file I manually create with PHP like the following:

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
CLASS:PUBLIC
DESCRIPTION:Some description here
LOCATION:Scheduled PTO
DTEND;VALUE=DATE:20101104
DTSTART;VALUE=DATE:20101103
PRIORITY:5
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:PTO - 8.00 hour(s)
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
END:VEVENT
END:VCALENDAR

This works fine when importing into outlook 2007 (as well as Google calendar). In outlook 2003 I get the following error:

"This error can appear if you have attempted to save a recurring Lunar Calendar in iCalendar format. To avoid this error, set the appointment option to Gregorian instead of Lunar."

Is there something I need to change in the .ics file to get this to work with Outlook 2003?

(I don't have Outlook 2003 to test with at the moment)

Jason
  • 15,017
  • 23
  • 85
  • 116
  • 1
    PHP can't generate .ics files. A library written in PHP however can, maybe you name it in your post? – halfdan Apr 14 '11 at 22:39
  • 1
    Sorry, I don't use a library, I create the ics file manually. Question updated... – Jason Apr 14 '11 at 23:57

4 Answers4

4

So, after some trial and error with a 2003 test system and I found that adding the following:

DTSTAMP:20101103T120000Z

allowed Outlook 2003 to import the .ics file without breaking 2007, iCal or Google.
I also, for good measure added the UID line to my final .ics file.

So, my final .ics file looks like this:

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
CLASS:PUBLIC
DESCRIPTION:Some description here
LOCATION:Scheduled PTO
DTEND;VALUE=DATE:20101104
DTSTART;VALUE=DATE:20101103
DTSTAMP:20101103120000Z
UID: VACATIOND41D8CD98F00B204E9800998ECF8427E
PRIORITY:5
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:PTO - 8.00 hour(s)
X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
END:VEVENT
END:VCALENDAR

All I did was create a manual entry in outlook 2003, saved it as a .ics and did a comparison on what was missing/different from my original.

All works well now.

UPDATE One additional change, I removed the VERSION:2.0 bit and that made all work even more reliably.

Jason
  • 15,017
  • 23
  • 85
  • 116
  • Tried in 2003 and it does NOT work. Comes up with a message saying some fields are invalid. Works in 2010 though. Are you meaning it works with 2010 and 2007? – csharpforevermore Jan 19 '12 at 13:13
2

Add:

CALSCALE:GREGORIAN
METHOD:PUBLISH 

That worked for me.

Evgeny Gorb
  • 1,442
  • 2
  • 13
  • 24
Don
  • 21
  • 1
0

Deleting "VERSION:2.0" was all it took to make a 3rd party .ics meeting open fine for me in Outlook 2003.

Andrew
  • 1
0

It does indeed appear that 2003 has need of the following three fields: the METHOD field posted outside of the VEVENT section, and within the VEVENT section the DTSTAMP and UID fields. DTSTAMP must be a valid timestamp so you can just copy the value found under DTSTART, and UID can be an arbitrary string it appears.

METHOD:PUBLISH
DTSTAMP;VALUE=DATE-TIME:$COPY_VALUE_AT_DTSTART
UID:placeholder

I have also come across calendar events which include an ATTENDEE# field, eg ATTENDEE#<Client 300000 "Jane Doe">. I removed that line and got the file to import. All these malformed ics files failed with a message stating

Microsoft Office Outlook

Cannot import vCalendar file.

Show Help >>

jxramos
  • 7,356
  • 6
  • 57
  • 105