开发者

Outlook 2003 does not import .ics calendar while outlook 2007 does

开发者 https://www.devze.com 2023-02-25 03:29 出处:网络
I have an .ics file I manually create with PHP like the following: BEGIN:VCALENDAR PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN

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-MICR开发者_JS百科OSOFT-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)


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.


Add:

CALSCALE:GREGORIAN
METHOD:PUBLISH 

That worked for me.


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


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 >>

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号