M
Mike V
I have an application which integrates with Outlook using the
Redemption.dll
Currently when a user enters a string the program searches the users
Outlook contact folder using the Outlook.MAPIFolder.Item.Restrict
method so that a typical query would be:
"[MessageClass]='IPM.Contact' AND [FileAs] >= '" + sSearchFor + "' AND
[FileAs] < '" + sSearchFor + "z'"
Generally this works fine so long as the user is using the standard
Contact form.
The problem I am having is that if a user has a custom contact form
then the message class could be 'IPM.Contact.MyCustomContact' in which
case my application will not find anything.
I could omit the [MessageClass] clause all together, accept that if a
user has a group or some other message type in the contact folder, such
as a Contact Group, then that would cause my application to choke on
that entry.
Now I could fairly easily add a field to the my apps program settings
that would allow a user to specify a custom contact Message Class so
that my restrict clause would be
[MessageClass]='IPM.Contact.MyCustomContact', but my problem with that
is the user could potentially have multiple contact form types in their
Contact folder, so I would still be missing out on some contacts.
So the question is what is the best way to select only contacts but not
exclude custom contact types?
Redemption.dll
Currently when a user enters a string the program searches the users
Outlook contact folder using the Outlook.MAPIFolder.Item.Restrict
method so that a typical query would be:
"[MessageClass]='IPM.Contact' AND [FileAs] >= '" + sSearchFor + "' AND
[FileAs] < '" + sSearchFor + "z'"
Generally this works fine so long as the user is using the standard
Contact form.
The problem I am having is that if a user has a custom contact form
then the message class could be 'IPM.Contact.MyCustomContact' in which
case my application will not find anything.
I could omit the [MessageClass] clause all together, accept that if a
user has a group or some other message type in the contact folder, such
as a Contact Group, then that would cause my application to choke on
that entry.
Now I could fairly easily add a field to the my apps program settings
that would allow a user to specify a custom contact Message Class so
that my restrict clause would be
[MessageClass]='IPM.Contact.MyCustomContact', but my problem with that
is the user could potentially have multiple contact form types in their
Contact folder, so I would still be missing out on some contacts.
So the question is what is the best way to select only contacts but not
exclude custom contact types?