如何获取本机outlook中的待办事项信息,信息
已经知道各自outlook的账号,密码,如何访问本地outlook获取其待办事项,最好有代码示意,感谢! outook 待办事项 --------------------编程问答--------------------路过-顶-闪人。 --------------------编程问答-------------------- 这个估计需要微软的接口吧 --------------------编程问答-------------------- Outlook.Application outlook = new Outlook.Application();
Outlook.NameSpace ns = outlook.GetNamespace("Mapi");
Outlook.MAPIFolder todoFolder = null;
Outlook.Items todoFolderItems = null;
Outlook.TaskItem task = null;
Outlook.ContactItem contact = null;
Outlook.MailItem email = null;
string todoString = string.Empty;
todoFolder = ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderToDo);
todoFolderItems = todoFolder.Items;
for (int i = 1; i <= todoFolderItems.Count; i++)
{
object outlookItem = todoFolderItems[i];
if (outlookItem is Outlook.MailItem)
{
email = outlookItem as Outlook.MailItem;
todoString += String.Format("Email: {0} Due:{1}{2}",
email.Subject, email.TaskDueDate, Environment.NewLine);
}
else if (outlookItem is Outlook.ContactItem)
{
contact = outlookItem as Outlook.ContactItem;
todoString += String.Format("Contact: {0} Due:{1}{2}",
contact.FullName, contact.TaskDueDate, Environment.NewLine);
}
else if (outlookItem is Outlook.TaskItem)
{
task = outlookItem as Outlook.TaskItem;
todoString += String.Format("Task: {0} Due: {1}{2}",
task.Subject, task.DueDate, Environment.NewLine);
}
else
MessageBox.Show("Unknown Item type");
Marshal.ReleaseComObject(outlookItem);
}
MessageBox.Show(todoString);
*****************************************************************************
签名档: http://feiyun0112.cnblogs.com/
补充:.NET技术 , C#