vsto 读取文件在项目发送时失败

vsto reading file fails on item send

在我的 Outlook 2013-2016 插件中,我使用附件。附件通过 属性 http://schemas.microsoft.com/mapi/proptag/0x37010102 在项目发送和项目查看时加载。

byte[] attachmentData = attachment.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x37010102");

在项目查看附件加载成功,我可以使用它,但在项目发送时我得到异常 The property http://schemas.microsoft.com/mapi/proptag/0x37010102 is unknown or cannot be found。我知道大文件会抛出异常,但我加载小的 .txt 文件并得到异常。此外,该问题仅在 x64 Outlook 中出现(我在 Outlook 2013 x86、Outlook 2016 x86 和 Outlook 2016 x64 上进行了测试)。 是否有其他加载附件的方法?

"Large" 文件表示任何超过 32 kB 的文件。确保先保存邮件 (MailItem.Save) 并检查附件类型 - PR_ATTACH_DATA_BIN 仅适用于 olByRef 附件。