【问题标题】:How to access the MS Outlook mail using the EntryIDCollection?如何使用 EntryIDCollection 访问 MS Outlook 邮件?
【发布时间】:2013-05-15 01:00:17
【问题描述】:

我正在使用此代码阅读 Outlook 邮件:

Microsoft.Office.Interop.Outlook.Application myApp = new Microsoft.Office.Interop.Outlook.Application();
Microsoft.Office.Interop.Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
Microsoft.Office.Interop.Outlook.MAPIFolder myInbox = mapiNameSpace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
int i = myInbox.Items.Count;
string strSubject = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).Subject;
string senderEmailid = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).SenderEmailAddress;
string ToEmailid = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).To;
string CcEmailid = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).CC;
string BccEmailid = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).BCC;
string CreationTime = ((Microsoft.Office.Interop.Outlook.MailItem)myInbox.Items[i]).CreationTime.ToString();

我也收到了EntryIDCollection。如何在我的代码中使用EntryIDCollection 而不是邮件计数(即i)来阅读邮件?

我正在使用 MS Outlook 2010。

【问题讨论】:

    标签: c# c#-4.0 outlook outlook-2010


    【解决方案1】:

    您可以使用Namespace.GetItemFromID

    【讨论】:

      猜你喜欢
      • 2018-01-11
      • 2011-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多