PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins Complex Find Filters, example: ((A Or B Or C) And D)

Reply

Complex Find Filters, example: ((A Or B Or C) And D)

 
Thread Tools Rate Thread
Old 08-12-2003, 07:39 PM   #1
Jim
Guest
 
Posts: n/a
Default Complex Find Filters, example: ((A Or B Or C) And D)


Hello,

I know how to implement an OR based find filter 'A Or B':

strFilter = _
"[Business Phone] = """ & strNumber & """ Or " & _
"[Home Phone] = """ & strNumber & """"

and I know how to implement an AND based find filter 'A And B':

strFilter = "[FullName] = """ & strName & """ And " & _
"[BusinessTelephoneNumber] = """ & strNumber & """"

But how do I specify an '((A Or B Or C) And D)' find filter?

I want to select a Contact item that matches any one of several
Contact phone number fields against a value, and that also matches
against a name field.

Conceptually (with the quotes removed for readability), this would be
something like:

strFilter = _
[ [Business Phone] = strNumber Or
[Home Phone] = strNumber Or
[Mobile Phone] = strNumber Or ]
And
[ [FullName] = strName ]

If this is possible, I would appreciate a minimal code snippet that
shows compilable syntax, with quotes/etc.

Am I thinking about this right, using the find filter? Or should I
just write code to search the Contact folder myself, where I have full
control and can get as fancy as I want with selection logic?

If the find filter will support complex searches, I assume that it is
somehow more efficient than coming back to my Add-In for processing
for each Contact item in the folder. Is that correct? Is there real
merit in pursuing a find filter based solution?

Thanks.

Jim
  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off