Szerkesztés

Megosztás a következőn keresztül:


Store.IsInstantSearchEnabled property (Outlook)

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

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.

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

Store Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.