0

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

Pratik Ratanpara
  • 338
  • 2
  • 15

1 Answers1

0

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.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45