Results Object (Outlook)
Collapse the table of content
Expand the table of content
This documentation is archived and is not being maintained.

Results Object (Outlook)

Contains data and results returned by the Search object and the AdvancedSearch method.

The Results object contains properties and methods that allow you to view and manipulate data. For example the GetNext, GetPrevious, GetFirst, and GetLast methods allow you to search through the results and view the data by field. The Sort method allows you to sort the data.

Use the SearchObject.Results property to return a Results object.

The following event procedure stores the results of a search in a variable named objRsts and displays the results of the search in the Immediate window.

Private Sub Application_AdvancedSearchComplete(ByVal SearchObject As Search) 
 Dim objRsts As Outlook.Results 
 MsgBox "The search " & SearchObject.Tag & _ 
 "has completed. The scope of the search was " & _ 
 SearchObject.Scope & "." 
 Set objRsts = SearchObject.Results 
 'Print out number in Results collection 
 Debug.Print objRsts.Count 
 'Print out each member of Results collection 
 For Each Item In objRsts 
 Debug.Print Item 
End Sub 

© 2016 Microsoft