CDO AddressEntryFilter

M

mgarg

Hi All,

I am trying to get the filtering work but i get MAPI_E_TOO_COMPLEX
error. Can anyone help me please

Dim oSession as MAPI.Session
Dim oAddressList as MAPI.AddressList
Dim oAddressEntries as MAPI.AddressEntries
Dim count as Integer

Set oSession = CreateObject("MAPI.Session")
oSession.LogOn
Set oAddressList = oSession.AddressLists.Item("Contacts")
Set oAddressEntries = oAddressList.AddressEntries
Set oAddressEntryFilter = oAddressEntries.Filter
Set oFields = oAddressEntryFilter.Fields
oFields.Add CdoPR_BUSINESS_TELEPHONE_NUMBER, "111111"
count = oAddressEntries.Count

I get the error when i try to get the count.

Mita

Any help will be appreciated

Mita
 
K

Ken Slovak - [MVP - Outlook]

You may not be able to filter on that field. Despite what the CDO help file
implies the fields you can filter an AddressEntries collection on are pretty
limited. I don't see any syntax errors in your code snippet and
MAPI_E_TOO_COMPLEX is pretty definitive.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top