Microsoft.Office.Interop.Outlook;
Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.NameSpace oNS = oApp.GetNamespace("MAPI");//mapi
Microsoft.Office.Interop.Outlook.ApplicationClass olObj = new Microsoft.Office.Interop.Outlook.ApplicationClass();//Get the MAPI namespace
Microsoft.Office.Interop.Outlook.Recipient rec = olObj.GetNamespace("MAPI").CreateRecipient("jiangpeng0623@outlook.com");//"xu, dan"是共享的会议室calendar的名称。
Microsoft.Office.Interop.Outlook.MAPIFolder oCalendar = oNS.GetSharedDefaultFolder(rec, Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar);
Microsoft.Office.Interop.Outlook.Items oItems = oCalendar.Items;
Microsoft.Office.Interop.Outlook.AppointmentItem oAppt = (Microsoft.Office.Interop.Outlook.AppointmentItem)oItems.GetFirst();
string str = "";
for (int i = 1; i <= oItems.Count; i++)
// Show some common properties.z
{
str += str + "Subject:" + oAppt.Subject + "\r\n";
str += str + "Organizer:" + oAppt.Organizer + "\r\n";
str += str + "Start:" + oAppt.Start.ToString() + "\r\n";
str += str + "End:" + oAppt.End.ToString() + "\r\n";
str += str + "Location:" + oAppt.Location + "\r\n";
str += str + "Recurring:" + oAppt.IsRecurring + "\r\t------------------------" + i.ToString();
oAppt = (Microsoft.Office.Interop.Outlook.AppointmentItem)oItems.GetNext();
}
Console.WriteLine(str);
Console.ReadLine();
这个获取的OutLook中普通的约会,如果是定期约会的话,就没办法获取了,求解?