更新时间:2023-09-26 20:05:16
这就是我的做法;
Outlook.Application myApp = new Outlook.Application();
Outlook.NameSpace mapiNameSpace = myApp.GetNamespace("MAPI");
Outlook.MAPIFolder myInbox = mapiNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox).Folders["QC"];
这应该会将所有邮件带入收件箱.然后调用;
This should bring all mails in Inbox. Then call;
Outlook.MailItem mailItem = myInbox.Items[1];
此mailItem
包含您需要的所有属性.
This mailItem
contains all the attributes you need.
说明:mailFolder.Items[1]
是一个 Outlook.Items
对象,它没有您需要的属性.您需要将其转换为 Outlook.MailItem
对象以实现此目的.
Explanation: The mailFolder.Items[1]
is an Outlook.Items
object which has no attributes you require. You need to cast it to an Outlook.MailItem
object to achieve this.