我正在以编程方式创建一个新的资源管理器窗口来查找 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”识别为搜索结果。
我需要使用什么字符串来获取一年前或更长时间收到的所有物品?