AdvancedSearchComplete Event

Microsoft Outlook Visual Basic

AdvancedSearchComplete Event

       

Occurs when the AdvancedSearch method has completed. The AdvancedSearchComplete event is used to return the object that was created by the AdvancedSearch method.

Private Sub expression_ AdvancedSearchComplete(ByVal SearchObject As Object)

expression   A variable which references an object of type Application declared with events in a class module.

SearchObject  The Search object returned by the AdvancedSearch method.

Remarks

This event only fires when the AdvancedSearch method was executed programmatically.

Example

The following example displays the number of objects returned by the search.

Private Sub olApp_AdvancedSearchComplete(ByVal SearchObject As Search)
        'Get Search object's results collection.
        Dim myResults As Results
        Set myResults = SearchObject.Results
        'Display the number of objects found in the search
        MsgBox "The number of objects found in the search is: " & myResults.Count
End Sub