Sub Sample_Advanced_Search()
Dim mySearch As Search
Dim myResults As Results
Dim intCounter As Integer
Set mySearch = AdvancedSearch(Scope:="Inbox",Filter:="urn:schemas:mailheader:subject = 'Project'")
Set myResults = mySearch.Results
If myResults.Count > 0 Then
Debug.Print "found"
For intCounter = 1 To myResults.Count
Debug.Print myResults.Item(intCounter).SenderName
Next intCounter
Else
Debug.Print "no messages that match the search criteria."
End If
End Sub