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