hello all

i am programming with outlook xp on exchange server for an interface for our application.
my program (it is a com-addin for outlook) should check the incoming email and if the email address of the sender is found in a contact in the public exchange contact folder i have to link the email with the contact(so that when the user opens the contact he should be able to see all the mails which came from the contact in the activities tab of the contact).

but how can i make a detailed search the public contact folder for a match of e-mail address and other fields like name(with Outlook object model or with CDO) i have these problems:: i want to make an advanced search on name, email,location etc with the user input from a screen.

i know that i can use the "Find" method of items in the folder but this looks for the exact match of fields. and if i use the "AdvancedSearch" method of Outlook Application object the Scope parameter does not accept the public folder name and shows error message. This method works fine in seaching the user'S contact folder. is there any way i can search these fields like in an SQL

WHERE clause "email LIKE 'blahh%'"??

or is there any other way to get the contact object(the ContactItem object) from the recieved mail? can anyone help me please? i need it very urgently.

thanx in adv

Nice