using Outlook = Microsoft.Office.Interop.Outlook;// Create an Outlook Application objectOutlook.Application outlookApp = new Outlook.Application (); Outlook.TaskItem myTask = (Outlook.TaskItem ) outlookApp.CreateItem(Outlook.OlItemType.olTaskItem);myTask.Subject = "Task, created in C#";myTask.Body = "This is the body of Task item created in C#";myTask.DueDate = DateTime.Now;myTask.Save ();// Create a namespaceOutlook.NameSpace ns = outlookApp.GetNamespace ("MAPI");// Get all tasksOutlook.MAPIFolder myTasks = ns.GetDefaultFolder (Outlook.OlDefaultFolders.olFolderTasks);foreach (Outlook.TaskItem task in myTasks.Items){ if (task.Complete) { // Display the creation time and body string str = task.CreationTime + ": " + task.Body; MessageBox.Show (str); }}
http://www.wangchao.net.cn/bbsdetail_577998.html
然后用webservice和Server端连起来
using Outlook = Microsoft.Office.Interop.Outlook;// Create an Outlook Application objectOutlook.Application outlookApp = new Outlook.Application ();
Outlook.TaskItem myTask = (Outlook.TaskItem ) outlookApp.CreateItem(Outlook.OlItemType.olTaskItem);myTask.Subject = "Task, created in C#";myTask.Body = "This is the body of Task item created in C#";myTask.DueDate = DateTime.Now;myTask.Save ();// Create a namespaceOutlook.NameSpace ns = outlookApp.GetNamespace ("MAPI");// Get all tasksOutlook.MAPIFolder myTasks = ns.GetDefaultFolder (Outlook.OlDefaultFolders.olFolderTasks);foreach (Outlook.TaskItem task in myTasks.Items){ if (task.Complete) { // Display the creation time and body string str = task.CreationTime + ": " + task.Body; MessageBox.Show (str); }}
它获取的是哪里的email?看不懂,请说说