简体   繁体   English

如何在 outlook 2010 中为 Outlook DocumentItem 设置 PR_MESSAGE_DELIVERY_TIME

[英]How to set PR_MESSAGE_DELIVERY_TIME in outlook 2010 for Outlook DocumentItem

I have an add-in in Microsoft outlook.我在 Microsoft outlook 中有一个加载项。 I tried to set Received value of outlook DocumentItem using below method.我尝试使用以下方法设置 outlook DocumentItem 的接收值。

  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.我已经检查了 Outlook 2013、2016 和 365。它工作正常,但在 outlook 2010 中我无法更改日期。 It will throw an exception Error: The operation failed.它将抛出异常错误:操作失败。

Can anyone have idea how to solve this problem?谁能知道如何解决这个问题?

Thanks谢谢

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.另一方面是Outlook object model可能会设置自己的业务规则,并阻止此类操作运行。 In such cases, you need to use a low-level API on which Outlook is built on.在这种情况下,您需要使用构建 Outlook 的低级 API。 Or just use any third-party wrappers around the API such as Redemption.或者只使用 API 周围的任何第三方包装器,例如 Redemption。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM