我偶然发现了一个问题,即 Outlook 项目表排序方法没有给出期望的结果——尽管 GetLast() 方法总是返回相同的电子邮件项目。代码如下:
Application olApp = new Application();
NameSpace olNS = olApp.GetNamespace("MAPI");
MAPIFolder oFolder = olNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
Explorer oExp = oFolder.GetExplorer(false);
//olNS.Logon( false, true);
result = new IOActionResult(null);
oFolder.Items.Sort("[ReceivedTime]");
var subject = oFolder.Items.GetLast().Subject;
我尝试指定以下内容:
oFolder.Items.Sort("[ReceivedTime]", true);
oFolder.Items.Sort("[ReceivedTime]", false);
oFolder.Items.Sort("[ReceivedTime]", OlSortOrder.olAscending);
oFolder.Items.Sort("[ReceivedTime]", OlSortOrder.olDescending);
这似乎也不起作用......任何想法表示赞赏!