Store.IsInstantSearchEnabled Property

Outlook Developer Reference

Returns a Boolean that indicates whether Instant Search is enabled and operational on a store. Read-only.

Version Information
 Version Added:  Outlook 2007

Syntax

expression.IsInstantSearchEnabled

expression   A variable that represents a Store object.

Remarks

Use IsInstantSearchEnabled to evaluate whether you should use ci_startswith or ci_phrasematch operators in your query. If you use ci_startswith or ci_phrasematch in the query and Instant Search is not enabled, Outlook will return an error.

Example

The following code sample accepts a matching string as an input parameter, constructs a DASL filter with the content indexing keyword ci_phrasematch if Instant Search is enabled on the store, and returns the filter. Otherwise, if Instant Search is not operational, then the code sample returns a filter that uses the like keyword.

For more information on filtering with keywords, see Filtering Items Using Query Keywords.

Visual Basic for Applications
  Function CreateSubjectRestriction(criteria As String) As String
    Dim result As String
    If Application.Session.DefaultStore.IsInstantSearchEnabled Then
        result = "@SQL=" & Chr(34) & "urn:schemas:httpmail:subject" _
            & Chr(34) & " ci_phrasematch '" & criteria & "'"
    Else
        result = "@SQL=" & Chr(34) & "urn:schemas:httpmail:subject" _
            & Chr(34) & " like '%" & criteria & "%'"
    End If
    CreateSubjectRestriction = result
End Function

See Also