System.Runtime.InteropServices.COMException ..Your服務器管理員已限制在Microsoft.Office.Interop.Outlook._AppointmentItem.get_UserProperties()展望收到COMException
你可以同時打開的項目數...
var calendar = outlookApplication.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderCalendar);
if (calendar == null || calendar.Items == null)
{
return null;
}
var calendarItems = calendar.Items;
if (calendarItems != null && calendarItems.Count > 0)
{
// Dont convert to LINQ or foreach please -> may cause Outlook memory leaks.
for (int counter = 1; counter <= calendarItems.Count; counter++)
{
var appointment = calendarItems[counter] as AppointmentItem;
if (appointment != null)
{
var userProperty = appointment.UserProperties.Find("myInformation");
if (userProperty != null && userProperty.Value == myValue)
{
return appointment ;
}
}
}
}
也許它appointment.UserProperties.Find( 「myInformation」)收到COMException原因?
對upvotes THX)那意味着有人讀它,發現它好) – MikroDel
你找到任何解決方案? – Florian
@ Anubis1233 - 我已經發布了我的回答 – MikroDel