Hello all,
I am attempting to use the Restrict function on a
collection of Appointment items to isolate which
appointments contain a specific Contact. A code sample is
as follows (where fldCateringCalendar contains all the
appointment items in a specific calendar folder):
'*** Begin Code Snippet ***'
strRestrictCriteria = "[Contacts]='John Smith'"
Set objCalendarItems = fldCateringCalendar.Restrict
(strRestrictCriteria)
'*** End Code Snippet ***'
If the Contacts field in the appointment ONLY contains
John Smith, then the Restrict function matches it and the
appointment is found in the objCalendarItems collection.
However, if the Contacts field contains another contact in
addition to John Smith (for example, John Smith; Mary
Jones), then the Restrict DOES NOT match and the
appoinment is not included in the objCalendarItems
collection.
Now for my question... is there a way to make Restrict
less restrictive so that if a contact is found in the
Contacts collection in the Appointment it will match
regardless of whether there are additional contacts
designated? Any help would be greatly appreciated.
Thanks,
Neil Dittmar
Software Developer
Aurora Information Systems
Ken Slovak - [MVP - Outlook] - 12 May 2004 16:05 GMT
There is no LIKE operator or wildcards that you can use in a restriction,
you have to use only the standard >, <, >=, <=, =, <> operators plus Or and
And (and Not).
You could use a CDO 1.21 MessageFilter or an Extended MAPI or Redemption
(www.dimastr.com/redemption) filter on a MAPITable, which are more flexible.

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> Hello all,
>
[quoted text clipped - 30 lines]
> Software Developer
> Aurora Information Systems