Board index » delphi » Retrieving Outlook Task StartDate property via HrGetOneProp
Lurkio
![]() Delphi Developer |
Retrieving Outlook Task StartDate property via HrGetOneProp2005-06-17 11:22:14 PM delphi85 Hello, I've been using Extended MAPI to get properties from Outlook tasks and this has been working fine... However, I have been having problems trying to retrieve the StartDate and EndDate properties of a task using the same code that worked so successfully for the other properties. The HrGetOneProp call in the following code snippet fails. I used OutlookSpy to get the IDs for for these properties the same way as I did for the other properties that worked such as Status and PercentComplete. const TaskItem_GUID : TGUID = '{00062003-0000-0000-C000-000000000046}'; procedure ViewTaskStartDate(const AMsg : IMessage); var namProp:array[0..0] of TMAPINAMEID; Names:array[0..0] of PMAPINAMEID; namTag : PSPropTagArray; PR_PROPERTY : ULONG; assContProp : PSPropValue; begin with namProp[0] do begin lpguid := @TaskItem_GUID; ulKind := MNID_ID; Kind.lID := $8104; // StartDate property ID end; Names[0] := @namProp[0]; if S_OK = AMsg.GetIDsFromNames(1, Names[0], MAPI_CREATE, namTag) then try PR_PROPERTY := PT_SYSTIME or namTag^.aulPropTag[0]; if S_OK = HrGetOneProp(AMsg, PR_PROPERTY, assContProp) then begin try // We've got the property... // <do stuff with it> finally MAPIFreeBuffer(assContProp); end; end else // This is what happens... MessageDlg('HrGetOneProp failed.', mtError, [mbOK], 0); finally MAPIFreeBuffer(namTag); end end; Does anyone have any ideas ? Thanks in advance, Lurkio |