How to set PR_MESSAGE_DELIVERY_TIME in outlook 2010 for Outlook DocumentItem

232 Views Asked by At

I have an add-in in Microsoft outlook. I tried to set Received value of outlook DocumentItem using below method.

  public void SetDocumentItemReceivedDate(Outlook.DocumentItem objDocumentItem, DateTime dateTime)
    {
        objDocumentItem.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x0E060040", dateTime);
    }

I have checked with Outlook 2013, 2016 and 365. It is working fine but in outlook 2010 I am not able to change the date. It will throw an exception Error: The operation failed.

Can anyone have idea how to solve this problem?

Thanks

1

There are 1 best solutions below

2
Eugene Astafiev On

This property must be set before posting document items to public folders. So, I'd suggest setting the property before the item is saved.

Another aspect is that the Outlook object model may set its own business rules and prevent such operations from running. In such cases, you need to use a low-level API on which Outlook is built on. Or just use any third-party wrappers around the API such as Redemption.