本文介绍了访问日程安排会议,MS Outlook中的Cander事件信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道我可以访问Outlook的cander事件,使用ASp.NET安排会议信息吗?

Hi,

I want to know Can I access the Outlook''s cander event, schedule meeting information using ASp.NET?

推荐答案

public  DataTable GetCalenderDetails()
        {
            DataTable table = new DataTable();
           table.Columns.Add("Subject", typeof(string));
           table.Columns.Add("Datetime", typeof(DateTime));
           table.Columns.Add("Location", typeof(string));
           table.Columns.Add("Organizer", typeof(string));
           Microsoft.Office.Interop.Outlook.Application oApp = null;
           Microsoft.Office.Interop.Outlook.NameSpace mapiNamespace = null;
           Microsoft.Office.Interop.Outlook.MAPIFolder calendarFolder = null;

           try
           {
               oApp = new Microsoft.Office.Interop.Outlook.Application();
               mapiNamespace = oApp.GetNamespace("MAPI");
               calendarFolder = mapiNamespace.GetDefaultFolder
               (Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar);

               DataRow dr;
               foreach (Microsoft.Office.Interop.Outlook.AppointmentItem item in
               calendarFolder.Items)
               {
                   dr = table.NewRow();
                   dr["Location"] = item.Location;
                   dr["Subject"] = item.Subject;
                   dr["Datetime"] = item.Start;
                   dr["Organizer"] = item.Organizer;
                   table.Rows.Add(dr);
               }
           }
           catch (Exception ex)
           {
               Console.WriteLine(ex.Message);
           }
           return table;
        }


这篇关于访问日程安排会议,MS Outlook中的Cander事件信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 06:08