Re: cdo Filtering according to Categories
- From: Bert_Bert <BertBert@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 19 Aug 2008 07:31:03 -0700
yes, that was exactly how I programatically got the correct PropID for
Categories.
I just wondered it is different at two OST files looking to the same
Exchange mailbox.
I also looked at exact Restriction model and tried to re-apply it
programatically to MAPITable object but it does NOT work.
What is not documented at any place and is a big question for me is for
example - shall I use
ulPropTag = 0x????001E or 0x????101E version and
shall I use for lpProp a string "mycateg" or shall I use an array
dim a (0) as String
a(0)="my_categ"
lpProp = a
when specifying Restriction for multivalued property ??
I am asking because none of the above works for me, it is NOT possible to
use restrictions since recordcount returned is either 0, or there is some
error.
If I use just String UserProperty for example, or built in property, the
filtering with ANDed criteria works perfect for me, so it is a mystery
why/whether keyword filtering in this way actually IS possible ??
Maybe Outlook uses dasl mechanism underhood - I can see it in Advanced tab
when creating filter, then I do not understand why I saw the raw Restrictions
structure with Outloomk spy, or, why it works for Outlook and does not work
for me in Visual Basic - through Redemption.
Maybe it is possible only in C language, not in VB code....
GetIDsFromNames() method. Let's say you have an RDOFolder object that is the.
source for the MAPITable. That object has a GetIDsFromNames() method that
you call to get back the correct property tag like this:
string catsGUID = "{00020329-0000-0000-C000-000000000046}";
const int PT_MV_STRING8 = 0x101E;
int Tag = folder.GetIDsFromNames(catsGUID, "Keywords") | PT_MV_STRING8;
A tool like OutlookSpy will let you see the component pieces of named
properties and let you get the GUID, type (PT_MV_STRING8) and ID, which can
be a word or an int value.
MAPI restrictions do take some getting used to, but all in all they're the
most powerful and flexible way to do filtering or restricting.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"Bert_Bert" <BertBert@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:29EB77F2-82EC-44D8-BE38-392A14291AC4@xxxxxxxxxxxxxxxx
Ken, thanks a lot for a good tip.
I converted to the redemption and I have a good feeling about that
wrapper.
However I have the same problem as before.
I have two ways how to filter with mapitable. The first one - SQL, seems
to
work for me, it is somehow difficult to formulate the dasl properties, but
Categories filtering works so far.
However the second way, the Filter, Restrictioning method that is also
described at Redemption web page very clearly DOES NOT work for categories
but does very well work for Textual and other types.
I followed the hint regarding the Outlook spy to find IOut what Outlook
uses
when he makes filtering according to categories. It showed me:
rt : RES_AND
res.resAnd :
cRes : 2
lpRes :
rt : RES_AND
res.resAnd :
cRes : 3
lpRes :
rt : RES_CONTENT
resContent :
ulFuzzyLevel : FL_FULLSTRING FL_IGNORECASE
ulPropTag : 0x8014 (0x8014101E)
lpProp :
ulPropTag : 0x8014 (0x8014001E)
Value : my_category_name_i_want_to_filter
rt : RES_CONTENT
resContent :
ulFuzzyLevel : FL_FULLSTRING FL_IGNORECASE
ulPropTag : 0x844F (0x844F101E)
lpProp :
ulPropTag : 0x844F (0x844F001E)
Value : another_multivalued_keyword_from_cu_defned_mv_field
rt : RES_CONTENT
resContent :
ulFuzzyLevel : FL_FULLSTRING FL_IGNORECASE
ulPropTag : 0x844D (0x844D001E)
lpProp :
ulPropTag : 0x844D (0x844D001E)
Value : just_textual_filter
rt : RES_OR
res.resOr :
cRes : 2
lpRes :
rt : RES_CONTENT
resContent :
ulFuzzyLevel : FL_PREFIX FL_IGNORECASE
ulPropTag : PR_MESSAGE_CLASS (0x001A001E)
lpProp :
ulPropTag : PR_MESSAGE_CLASS (0x001A001E)
Value : IPM.Task
rt : RES_CONTENT
resContent :
ulFuzzyLevel : FL_PREFIX FL_IGNORECASE
ulPropTag : PR_MESSAGE_CLASS (0x001A001E)
lpProp :
ulPropTag : PR_MESSAGE_CLASS (0x001A001E)
Value : IPM.TaskRequest
I tried to re-establish the RES_CONTENT with categories exactly as Outlook
does, I tried to mask 1000 as multivalued and also without the mask, I
tried
to give him just string value of "searched_categ" and also to create
string
array, but again, with no success.
Textual, boolean and message class work perfect for me.
The property tag for category I tried to determine programatically
thgrough
mapiutils->getidsfromnames and it is strange I received something
different
than 0x8014, i.e. something different than Outlook seems to use.
Can it be that at different machine property tag of Categories is
different
than on another machine ?
I would really like to understand a bit more from HOW the Outlook client
actually does this filtering, but it seems noone ever has solved it,
because
there is no clue in groups so far about Categories filtering.
I believe the DASL way will be satisfactory for me :-)
thanks again for you hints
- Follow-Ups:
- Re: cdo Filtering according to Categories
- From: Ken Slovak - [MVP - Outlook]
- Re: cdo Filtering according to Categories
- References:
- Re: cdo Filtering according to Categories
- From: Ken Slovak - [MVP - Outlook]
- Re: cdo Filtering according to Categories
- From: Bert_Bert
- Re: cdo Filtering according to Categories
- From: Ken Slovak - [MVP - Outlook]
- Re: cdo Filtering according to Categories
- From: Bert_Bert
- Re: cdo Filtering according to Categories
- From: Ken Slovak - [MVP - Outlook]
- Re: cdo Filtering according to Categories
- Prev by Date: Re: COM add-in can't update sent message MAPI properties in Outlook XP...
- Next by Date: Turn Off Outlook Security Feature
- Previous by thread: Re: cdo Filtering according to Categories
- Next by thread: Re: cdo Filtering according to Categories
- Index(es):
Relevant Pages
|