I want to get a list of all of the calendars (folders) in my outlook and put them into a combo box. I have a top level Idea of how to do it, but I don't know enough about the Microsoft.Office.Interop.Outlook; to get the data. I'm sure it will be some kind of a for each combobox1.Items.add(Calendar);
Full disclosure: It is my plan to write a form application that will have a combobox to select the folder, another to select the items, and then populate the form from the item selected.
private void button2_Click(object sender, EventArgs e)
{
Microsoft.Office.Interop.Outlook.Application oApp = null;
Microsoft.Office.Interop.Outlook.NameSpace mapiNamespace = null;
Microsoft.Office.Interop.Outlook.MAPIFolder CalendarFolder = null;
Microsoft.Office.Interop.Outlook.Items outlookCalendarItems = null;
oApp = new Microsoft.Office.Interop.Outlook.Application();
//mapiNamespace = oApp.GetNamespace("MAPI"); ;
//CalendarFolder = mapiNamespace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar);
CalendarFolder = mapiNamespace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar);
outlookCalendarItems = CalendarFolder.Items;
outlookCalendarItems.IncludeRecurrences = true;
foreach (Microsoft.Office.Interop.Outlook.MAPIFolder item in CalendarFolder)
{
}
}