System.Runtime.InteropServices.COMException ..サーバー管理者は、同時に開くことができるアイテムの数を制限しています...
Microsoft.Office.Interop.Outlook._AppointmentItem.get_UserProperties() で
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 ;
}
}
}
}
多分その任命.UserProperties.Find("myInformation")はCOMExceptionを引き起こしますか?