Results Object

Outlook Developer Reference

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

Remarks

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.

Example

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.

Visual Basic for Applications
  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
Next

End Sub

See Also