Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / May 2004

Tip: Looking for answers? Try searching our database.

Uses Restrict function on Contacts field of Appointment items

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Neil Dittmar - 12 May 2004 14:23 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.