我正在开发一个将表单区域添加到 IPM.Appointment 消息类的 Outlook 加载项。当这个区域显示出来时,它首先会向 AppointmentItem 添加一些属性。
Outlook.AppointmentItem appItem;
private void FormRegion_FormRegionShowing(object sender, System.EventArgs e)
{
try
{
appItem = (Outlook.AppointmentItem)this.OutlookItem;
appItem.ItemProperties.Add("CustomProperty", Outlook.OlUserPropertyType.olText);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
这在我的日历上运行良好,但如果我尝试将插件与我拥有编辑器或所有者访问权限的委托日历一起使用,则会引发以下异常:
System.UnauthorizedAccessException: You don't have appropriate permission to perform this operation.
at Microsoft.Office.Interop.Outlook.Itemproperties.Add(String Name, OlUserPropertType Type, ObjectAddToFolderFields, Object DisplayFormat)
at ThisAddin.FormRegion.FormRegion_FormRegionShowing(Ovject sender,EventArgs e)
任何和所有的帮助表示赞赏!