Outlook 插件 - ItemProperties.Add 更改邮件格式
Outlook Addin - ItemProperties.Add change the mail format
我正在尝试添加一个项目 属性 如下:
Microsoft.Office.Interop.Outlook.ItemProperty property = currentMail.ItemProperties.Add("isCopy", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olYesNo);
property.Value = false;
问题是它正在更改电子邮件格式。
添加此 属性 之前,电子邮件发送如下:
Formatted
添加此 属性 后,电子邮件发送如下:
No Formatted and with attached file
另外,我已经试过了UserProperties.Add。行为相同。
为了不被卡住,我已经实施了一些不太优雅的解决方法。
如前所述,我需要知道 MailItem 是否为副本。所以我将 EntryID 保存在副本列表中。
对象 X:
thisAddIn.AddEntryIdCopy(mailItem.EntryID);
对象 Y:
thisAddIn.ContainsEntryIdCopy(mailItem.EntryID)
Ps.: 由于当 MailItem 移动到不同的文件夹时 EntryId 会发生变化,这种方式只要 MailItem 有效在同一文件夹中。
添加用户 属性 会导致 Outlook 以 TNEF (RTF) 格式发送邮件(臭名昭著的 winmail.dat)。
您可以使用 MailItem.PropertyAccessor.SetProperty
(而不是使用 UserProperties.Add
)通过 DASL 名称设置 属性,或者设置一个名为 属性 的特殊 UseTnef
在调用 Send.
之前使用 MailItem.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8582000B", false)
设置为 false
我正在尝试添加一个项目 属性 如下:
Microsoft.Office.Interop.Outlook.ItemProperty property = currentMail.ItemProperties.Add("isCopy", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olYesNo);
property.Value = false;
问题是它正在更改电子邮件格式。
添加此 属性 之前,电子邮件发送如下:
Formatted
添加此 属性 后,电子邮件发送如下:
No Formatted and with attached file
另外,我已经试过了UserProperties.Add。行为相同。
为了不被卡住,我已经实施了一些不太优雅的解决方法。
如前所述,我需要知道 MailItem 是否为副本。所以我将 EntryID 保存在副本列表中。
对象 X:
thisAddIn.AddEntryIdCopy(mailItem.EntryID);
对象 Y:
thisAddIn.ContainsEntryIdCopy(mailItem.EntryID)
Ps.: 由于当 MailItem 移动到不同的文件夹时 EntryId 会发生变化,这种方式只要 MailItem 有效在同一文件夹中。
添加用户 属性 会导致 Outlook 以 TNEF (RTF) 格式发送邮件(臭名昭著的 winmail.dat)。
您可以使用 MailItem.PropertyAccessor.SetProperty
(而不是使用 UserProperties.Add
)通过 DASL 名称设置 属性,或者设置一个名为 属性 的特殊 UseTnef
在调用 Send.
MailItem.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8582000B", false)
设置为 false