Restrict method & [Categories] 
Author Message
 Restrict method & [Categories]

According to the documentation, Categories cannot be used with the Restrict
nor Find methods and will cause an error.  I've found this to be untrue
since I can successfully Restrict to a particular category, or Restrict to
any category (eg. [Categories] <> "").

What I want is to Restrict to records with no category like so:
[Categories] = ""
but this doesn't work.

When rewriting and negating the previous statement, it DOES work:
Not [Categories] <> ""

Can somebody tell me what gives?  I use C++ but assume the documentation
isn't saying you can't Restrict categories only when using VB.  Is the
documentation wrong, is the Restrict method inconsistent or what's going on
here?



Tue, 02 Aug 2005 01:25:47 GMT  
 Restrict method & [Categories]
The reason is that on the MAPI level categories are stored as a multivalued
property (PT_MV_STRING8), not as a single string that OOM exposes. Searches
on the multivalued properties are tricky, but possible. I guess OOM just
does not do those tricks for whatever reasons.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy  - Outlook, CDO
and MAPI Developer Tool

Quote:

> According to the documentation, Categories cannot be used with the
Restrict
> nor Find methods and will cause an error.  I've found this to be untrue
> since I can successfully Restrict to a particular category, or Restrict to
> any category (eg. [Categories] <> "").

> What I want is to Restrict to records with no category like so:
> [Categories] = ""
> but this doesn't work.

> When rewriting and negating the previous statement, it DOES work:
> Not [Categories] <> ""

> Can somebody tell me what gives?  I use C++ but assume the documentation
> isn't saying you can't Restrict categories only when using VB.  Is the
> documentation wrong, is the Restrict method inconsistent or what's going
on
> here?



Wed, 03 Aug 2005 06:40:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. restricting contacts by categories

2. Adding a category to Master category list with VBA code

3. Using like conditions with restrict method

4. Restrict method problem

5. Restrict method parsing error

6. using Restrict items method

7. Creating Items collection using Find method instead of Restrict

8. Filter for RESTRICT method

9. Restrict method

10. Restrict Method with Appointment Items

11. Using Restrict Method

12. Restrict or Find method to get items with attachments

 

 
Powered by phpBB® Forum Software