[英]displaying the items of advanced search without saving in folder outlook vba
我想通过excel vba在Outlook中进行高级搜索,以便查找一些电子邮件并自动回复其中一封电子邮件。
我的问题是,我不知道如何将搜索结果作为一组项目来处理,无法按日期对它们进行排序并回复最新的项目,而又不会将其保存在任何搜索文件夹中。
到目前为止,我只能运行高级搜索并将搜索结果保存到文件夹中:
Sub test()
Dim Outl As Object
Dim TESTEfolder As Object
Dim Search As Object
Set Outl = CreateObject("Outlook.Application")
Set TESTEfolder = Outl.GetNamespace("MAPI").GetDefaultFolder(6).Folders("TESTE")
Set Search = Outl.AdvancedSearch("'" & TESTEfolder.FolderPath & "'")
Search.Save ("TESTEcopy") 'I want to skip this and handle the Items inside Search directly
End Sub
注意:我必须使用LATE绑定和高级搜索,而不是使用Find / Restrict / InStr
谢谢!
您无需保存搜索。 完成高级搜索后,Outlook.Application对象将引发事件: https : //msdn.microsoft.com/VBA/Outlook-VBA/articles/application-advancedsearch-method-outlook
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.