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)??

Re: search contacts by Peter

Peter
Thu Nov 24 06:05:06 CST 2005

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

--
Peter Foot
Windows Embedded MVP
www.peterfoot.net | www.inthehand.com

"droll" <droll@invalid.com> wrote in message
news:%23m9TTmO8FHA.3044@TK2MSFTNGP10.phx.gbl...
> 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)??
>
>