MAPITable on Tasks Folder with a Contacts Restriction

G

Guest

I am trying to use a MAPITable on the default tasks folder with a restriction
on Contacts field. Everytiem I attempt to apply the restriction the table
throws a MAPI_E_INVALID_PARAMETER error. I assume this is due to the kind of
MNID_ID versuses MNID_STRING kind. What I am doing is:

PR_CONTACTS =
sItem.GetIDsFromNames("{00062008-0000-0000-C000-000000000046}", &H819B) Or
PT_STRING8 Or &H1000
Set Filter = table.Filter
Filter.Clear
Set Restr = Filter.SetKind(RES_CONTENT)
Restr.ulFuzzyLevel = FL_SUBSTRING Or FL_IGNORECASE
Restr.ulPropTag = PR_CONTACTS
Restr.lpProp = oContact.FullName
Filter.Restrict

Any suggestions on how to configure this to be able to restrict on the
contacts field of the tasks folder?
 
K

Ken Slovak - [MVP - Outlook]

Are you positive about that &H819B ID?

On my machines here the ID value for Contacts is &H853A. I can get Contacts
as a PT_MV_STRING8 value by using this:

GetIDsFromNames("{00062008-0000-0000-C000-000000000046}", &H853A) Or
PT_STRING8 Or &H1000
 
G

Guest

You are correct H853A is the ID, I was trying other things (grasping...) when
I copied this code and forgot to change it back.

It still fails with the correct ID. I assume it has something to due with
the "Kind" of the field since it is ID and not String, I am just not sure
what to change.

Jack
 
Top