首页 > 解决方案 > 如何将自定义属性添加到 Outlook MailItem 的 InternetHeaders

问题描述

我需要从 VSTO 加载项将自定义 InternetHeader x-auth-guid 添加到 Outlook 收件箱(在 Exchange 帐户中)中的现有 MailItem。类似于此处描述的内容 https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/dd633654(v=exchg.80) 但没有 EWS。使用 EWS 的代码工作并执行以下操作:

extendedFieldURI.propertyName = "x-auth-guid"
extendedFieldURI.distinguishedPropertySetId = "InternetHeaders"
property.extendedFieldURI = extendedFieldURI
property.value = xauthGuid
message.addExtendedProperty(property)

但在两个 PropertyAccessor 的加载项中,例如:

mailItem.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/x-auth-guid",  xauthGuid);
mailItem.Save();

和救赎

rdoMail.Fields["http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/x-auth-guid"] = xauthnGuid;
rdoMail.Save();

似乎不起作用。我错过了什么吗?

标签: outlookvstooutlook-redemption

解决方案


推荐阅读