Question

During some work with MAPI I found very strange results for a few appointments, for example:

Tag: 0x00600040 Type: PT_SYSTIME Property Name(s): PR_START_DATE, PidTagStartDate DASL: http://schemas.microsoft.com/mapi/proptag/0x00600040 12:00:00 01.11.2012

Tag: 0x00610040 Type: PT_SYSTIME Property Name(s): PR_END_DATE, PidTagEndDate DASL: http://schemas.microsoft.com/mapi/proptag/0x00610040 02:30:00 01.11.2012

where EndDate is less than StartDate or EndDate is just different from that is shown in outlook calendar.

Appointment and Meeting Object Protocol Specification says that PidTagEndDate contains date and time of the appointment's end. But it seems that sometimes it contains length (2:30 in the example above). The most embarrasing thing about this is that Outlook shows dates correctly in calendars, so I need some way to interpret dates obtained from MAPI correctly.

Was it helpful?

Solution 2

Not sure about the reason but in my case PidTagEndDate (PR_END_DATE) is not correct on some appointments, in order to get right value one have to use other canonical property (if exists of course - it's not always set) PidLidAppointmentEndWhole to which according to specification PidTagEndDate MUST be equal but it seems not always true at all.

OTHER TIPS

Try do it like this

LPSPropTagArray lppPropTags;
ULONG ulPropCount;
LPSPropValue pProp;
SYSTEMTIME& tmEnd;


HRESULT hr=m_appointment->GetProps(lppPropTags, MAPI_UNICODE, &ulPropCount, &pProp);
MAPIFreeBuffer(lppPropTags);

FILETIME tmLocal;
FileTimeToLocalFileTime(&pProp->Value.ft, &tmLocal);
FileTimeToSystemTime(&tmLocal, &tmStart);

tmLocal variable will contain end time

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top