我有以下代码可以在Outlook中进行即时搜索,但是我不确定现在如何遍历这些结果以进行进一步的检查。
任何指针将不胜感激!
Sub SearchByAddress()
Dim myOlApp As New Outlook.Application
Dim ns As Outlook.NameSpace
Dim strFilter As String
Dim oMail As Outlook.MailItem
Set ns = myOlApp.GetNamespace("MAPI")
strFilter = "joebloggs@hotmail.com"
Set myOlApp.ActiveExplorer.CurrentFolder = ns.GetDefaultFolder(olFolderInbox)
txtSearch = "from:(" & Chr(34) & strFilter & Chr(34) & ") AND " & Chr(34) & "Check" & Chr(34)
myOlApp.ActiveExplorer.Search txtSearch, olSearchScopeAllFolders
Set myOlApp = Nothing
End Sub