search contacts

  • Thread starter Thread starter droll
  • Start date Start date
D

droll

is there a better way to search for a contact given say a last name, phone
number, email add etc., than to enumerate through
OutlookSession.Contacts.Items one by one???

i have to use native code (FindMatchingContact)??
 
The ContactCollection exposes a Restrict method which will return a
collection of items matching your query string e.g.

ContactCollection matchingItems = items.Restrict("[FirstName] = "John" AND
[LastName] = "Doe");

The SDK documentation has more details of the supported queries. You can
then enumerate over this specific collection.

Peter
 
Back
Top