【发布时间】:2016-11-21 16:39:56
【问题描述】:
我正在尝试在创建 MailItem 时将自定义 UserProperty 添加到它。
我将附件的哈希作为 UserProperty 添加到我的 MailItem 对象。 然后我在 Outlook 中打开我的新 MailItem。
mi = olApp.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
Outlook.UserProperties mailUserProperties = null;
Outlook.UserProperty mailUserProperty = null;
mi.Attachments.Add(file.FilePath);
mailUserProperties = mi.UserProperties;
mailUserProperty = mailUserProperties.Add("AttachementsHash", Outlook.OlUserPropertyType.olText);
mailUserProperty.Value = file.Hash;
mi.Save();
mi.Display();
如果我在发送前使用 OutlookSpy 检查 MailItem.UserProperties,我会看到我的邮件有一个 UserProperty。
然后我在 Outlook 中单击“发送邮件”,然后在 SentItems 文件夹中检查我的邮件。 我可以看到 UserProperties.Count == 0。
如果有人知道为什么我的 UserProperty 消失了,请帮助我并告诉 :)
【问题讨论】:
-
您使用哪种消息存储?命名属性 blob 是否与存储属性值的属性一起消失了(单击 OutlookSpy 中的 IMessage)?