System.Runtime.InteropServices.COMException .. Your server administrator has limited the number of items that you can open at the same time ...
at 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 ; } } } }
Maybe its purpose .UserProperties.Find ("myInformation") raises a COMException?
source share