1

我正在以编程方式创建一个新的资源管理器窗口来查找 1 年或更早的所有项目。

Outlook.Folder folder = (Outlook.Folder)Globals.ThisAddIn.Application.Session.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderInbox);
Outlook.Explorer newExplorer = Globals.ThisAddIn.Application.Explorers.Add(folder, Microsoft.Office.Interop.Outlook.OlFolderDisplayMode.olFolderDisplayNoNavigation);
DateTime expirationDate = DateTime.Now;
string searchSyntax = String.Format("urn:schemas:httpmail:datereceived < '{0}'", expirationDate);

newExplorer.Search(searchSyntax, Outlook.OlSearchScope.olSearchScopeAllFolders);
newExplorer.Display();

上面的代码不起作用,因为搜索无法识别urn:schemas:httpmail:datereceived < '4/18/2013 10:48:11 PM'为有效搜索。但是,它确实将“received:this year”或“received:last year”识别为搜索结果。

在此处输入图像描述

我需要使用什么字符串来获取一年前或更长时间收到的所有物品?

4

1 回答 1

1

http://msdn.microsoft.com/en-us/library/office/cc513841(v=office.12).aspx

<

received:<11/1/06 查找 11/1/06 之前收到的项目。

收到:<4/18/13

于 2013-04-19T03:22:06.283 回答