StringList ls = new StringList(); Type OutlookType; object oApp; object CalendarFolder; OutlookType = Type.GetTypeFromProgID("Outlook.Application"); if (OutlookType == null) { MessageBox.Show("MS-Outlook ist nicht installiert."); return new StringList(); } oApp = Activator.CreateInstance(OutlookType); object oNameSpace = oApp.GetType().InvokeMember("GetNamespace", BindingFlags.InvokeMethod, null, oApp, new object[1] { "MAPI" }); //MethodInfo mi1 = oNameSpace.GetType().GetMethod("GetDefaultFolder"); //9..eigener Kalender for (int i = 0; i < 30; i++) { try { object objDefaultFolder = oNameSpace.GetType().InvokeMember("GetDefaultFolder", BindingFlags.InvokeMethod, null, oNameSpace, new object[] { i }); object objFolderItems = objDefaultFolder.GetType().InvokeMember("Folders", BindingFlags.InvokeMethod, null, objDefaultFolder, null); int numofentries = (int)objFolderItems.GetType().InvokeMember("Count", BindingFlags.InvokeMethod, null, objFolderItems, null); object curObj = objFolderItems.GetType().InvokeMember("GetLast", BindingFlags.InvokeMethod, null, objFolderItems, null); // string strpf = (string)objContactItems.GetType().InvokeMember("FolderPath", BindingFlags.InvokeMethod, null, objContactItems, null); //ls.Add(strpf); try { string foldername = (String)curObj.GetType().InvokeMember("Name", BindingFlags.GetProperty, null, curObj, null); if(foldername.Contains("Termine Schule")) //when this directory is found { ls.Add(foldername); ls.Add(i.ToString()); ls.Add(numofentries.ToString()); try { object objCalendarItems = curObj.GetType().InvokeMember("Items", BindingFlags.InvokeMethod, null, curObj, null); int numofItems = (int)objCalendarItems.GetType().InvokeMember("Count", BindingFlags.InvokeMethod, null, objCalendarItems, null); //aktual count of Entries in the Calendar //Outlook.AppointmentItem oAppointment = (Outlook.AppointmentItem)outlookCalendarItems.Add(Outlook.OlItemType.olAppointmentItem); //add appointment without late binding object testobj=objCalendarItems.GetType().InvokeMember("Add", BindingFlags.InvokeMethod, null, objCalendarItems, new Object[] { "test" }); //my trying//...???? ls.Add(numofItems.ToString()); } catch (Exception ex) { ls.Add(ex.Message); } } } catch { } } catch(Exception ex) { } }