How to set the Recevied Time on an MailItem under Outlook?

Add-in Express™ Support Service
That's what is more important than anything else

How to set the Recevied Time on an MailItem under Outlook?
 
Guest


Guest


How to set the Recevied Time on an MailItem under Outlook?
Posted 07 May, 2004 10:16:24 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
This property is read-only in Outlook Object Model (OOM).

Sincerely,
ADX Support Team
Posted 07 May, 2004 10:50:57 Top
Guest


Guest


Is there another way to do that? I can use this code to set some readonly field, but cant find out the solution to set ReceivedTime, maybe the PropertyName is error.

Can u help me?

procedure HSetFieldValue(VIntf: OLEVariant; ulPropTag: ULONG; AValue: Variant);
var
  Intf: IUnknown;
  IMessage: MAPIDefs.IMessage;
  PropValue: TSPropValue;
  s: String;
  eSystemTime: Windows.SYSTEMTIME;
begin
  if VIntf.Class = olMail then
  begin
    Intf := VIntf.MAPIObject;
    Intf.QueryInterface(MapiDefs.IMessage, IMessage);
    if Assigned(IMessage) then
    try
      PropValue.ulPropTag:=ulPropTag;
      if (ulPropTag and PT_SYSTIME)<>0 then
      begin
        DateTimeToSystemTime(AValue, eSystemTime);
        Windows.SystemTimeToFileTime(eSystemTime, _FileTime(PropValue.Value.ft))
      end
      else
      begin
        PropValue.Value.lpszA:=PChar(VarToStr(AValue));
      end;
      HrSetOneProp(IMessage, @PropValue);
      VIntf.Save;
    finally
      IMessage := nil;
    end;
  end;
end;
Posted 29 May, 2004 02:26:44 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
The code looks well. But I suppose VIntf.Save should be changed to IMessage.SaveChanges. What Extended MAPI property tag do you use as the second parameter? PR_MESSAGE_DELIVERY_TIME?

Sincerely,
ADX Support Team
Posted 31 May, 2004 04:19:13 Top