Outlook reports the error "Cannot import vCalendar file"
on any text/calendar content that is missing the
attribute "DTSTAMP" - for example :-
DTSTAMP:20050520T170604Z
Here's some ytnef output that won't work in Outlook:-
------=_NextPart_000_0113_01C55FA0.C1123850
Content-Type: text/calendar; method=REQUEST;
charset="utf-8"
Content-Transfer-Encoding: 7bit
BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:-//The Gauntlet//ytnef 2.6//EN
VERSION:2.0
BEGIN:VEVENT
UID:040000008200E00074C5B7101A82E00800000000B
0BF5F973D5DC501000000000000000010000000B09275
9E781078498EBD0921871939BB
SEQUENCE:0
ORGANIZER;CN="JERROD@SALTBUSH.COM":MAILT
O:JERROD@SALTBUSH.COM
ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-
PARTICIPANT;RSVP=TRUE;CN="Scott
Smith":MAILTO:Scott Smith
SUMMARY:Scott Smith to interview Terrence Corgy
DESCRIPTION:\n When: Monday\, May 23\, 2005 2:00
PM-3:00 PM (GMT-05:00) Indiana (East).\nWhere:
Scott to call 301-736-5555 or 703-73
1-5555\n\n*~*~*~*~*~*~*~*~*~*\n\n\n
LOCATION: Scott to call 301-736-5555 or 703-731-5555
DTSTART:20050523T190000Z
DTEND:20050523T200000Z
CLASS:PRIVATE
END:VEVENT
END:VCALENDAR
------=_NextPart_000_0113_01C55FA0.C1123850
Here is some manually-adjusted-by-me version of the
above which *does* work OK in Outlook:-
------=_NextPart_000_0113_01C55FA0.C1123850
Content-Type: text/calendar; method=REQUEST;
charset="utf-8"
Content-Transfer-Encoding: 7bit
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 11.0
MIMEDIR//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-
PARTICIPANT;RSVP=TRUE;CN="Scott
Smith":MAILTO:Scott Smith
ORGANIZER;CN="JERROD@SALTBUSH.COM":MAILT
O:JERROD@SALTBUSH.COM
DTSTART:20050523T190000Z
DTEND:20050523T200000Z
LOCATION: Scott to call 301-736-5555 or 703-731-5555
SEQUENCE:0
UID:040000008200E00074C5B7101A82E00800000000B
0BF5F973D5DC5010000000000000000100
00000B092759E781078498EBD0921871939BB
DTSTAMP:20050520T170604Z
SUMMARY:Scott Smith to interview Terrence Corgy
DESCRIPTION:\n When: Monday\, May 23\, 2005 2:00
PM-3:00 PM (GMT-05:00) Indiana (East).\nWhere:
Scott to call 301-736-5555 or 703-73
1-5555\n\n*~*~*~*~*~*~*~*~*~*\n\n\n
CLASS:PRIVATE
END:VEVENT
END:VCALENDAR
------=_NextPart_000_0113_01C55FA0.C1123850
Logged In: NO
This suggested correction fixes this bug:-
*** vcal.c.ori 2004-04-09 18:24:59.000000000 +0000
--- vcal.c 2005-05-24 17:31:10.000000000 +0000
***************
*** 358,361 ****
--- 358,374 ----
}
+
+ // DTSTAMP (bug #1207989 fix by cnd)
+ if ((filename=MAPIFindProperty(&
(TNEF.MapiProperties),
+ PROP_TAG(PT_SYSTIME,
PR_CREATION_TIME)))
+ != MAPI_UNDEFINED) {
+ fprintf(fptr, "DTSTAMP:");
+ MAPISysTimetoDTR(filename->data, &thedate);
+ fprintf(fptr,"%04i%02i%02iT%02i%02i%02iZ\n",
+ thedate.wYear, thedate.wMonth,
thedate.wDay,
+ thedate.wHour, thedate.wMinute,
thedate.wSecond);
+ }
+
+
// Location
filename = NULL;
Logged In: NO
Here is the fix
*** vcal.c.ori 2004-04-09 18:24:59.000000000 +0000
--- vcal.c 2005-05-24 17:31:10.000000000 +0000
***************
*** 358,361 ****
--- 358,374 ----
}
+
+ // DTSTAMP (bug #1207989 fix by cnd)
+ if ((filename=MAPIFindProperty(&
(TNEF.MapiProperties),
+ PROP_TAG(PT_SYSTIME,
PR_CREATION_TIME)))
+ != MAPI_UNDEFINED) {
+ fprintf(fptr, "DTSTAMP:");
+ MAPISysTimetoDTR(filename->data, &thedate);
+ fprintf(fptr,"%04i%02i%02iT%02i%02i%02iZ\n",
+ thedate.wYear, thedate.wMonth,
thedate.wDay,
+ thedate.wHour, thedate.wMinute,
thedate.wSecond);
+ }
+
+
// Location
filename = NULL;