I am creating a appointment checker on outlook shared calendars by picking up the profiles from a inifile. It picks the first shared calendar but when it loops to the second, it gives me a null reference exception error. Can you advice what I am doing wrong.
Should the outlook recip be a list? Would appreciate some help
string CalendarName = iniFile.GetValue("Appointmentdays", "Calendarname");
List<string> names = CalendarName.Split(',').Reverse().ToList();
foreach (var name in names)
//for (var i = 0; i < names.Count; i++)
{
//Create Recipient
Outlook.Recipient recip = oApp.Session.CreateRecipient(name);
Outlook.MAPIFolder CalendarFolder = oNS.GetSharedDefaultFolder(recip, Outlook.OlDefaultFolders.olFolderCalendar);
String oCalendarName = CalendarFolder.Name;
String oCalendarEntryID = CalendarFolder.EntryID;
}