M
Mita Garg
Hi All,
I am developing a small vb application. I am reading the address
entries from the address list (address list can be any of the address
List) and trying to filter out the names which has Business Fax
number. But it just does'nt work. Can any one tell me, where I am
going wrong.
Your help will be really appreciated.
Private Sub Command1_Click()
Dim objCdo As MAPI.Session
Dim objFolder As MAPI.Folder
Dim objAddressList As MAPI.AddressList
Dim objAddressLists As MAPI.AddressLists
Dim objFilter As AddressEntryFilter
Dim objAddressEntries As MAPI.AddressEntries
Dim objAddressEntry As MAPI.AddressEntry
Dim ctr As Integer
Dim s As String
Set objCdo = CreateObject("MAPI.Session")
objCdo.Logon
Set objFolder = objCdo.Inbox
Set objAddressList = objCdo.AddressLists.Item("Contacts")
Set objAddressEntries = objAddressList.AddressEntries
ctr = objAddressEntries.Count ( I get ctr = 36)
Set objFilter = objAddressEntries.Filter
objFilter.Fields.Add CdoPR_BUSINESS_FAX_NUMBER, "BusinessFaxNumber"
' HERE I GET MAPI_E_TOO_COMPLEX
ctr = objAddressEntries.Count
End Sub
'I can get hold of the CdoPR_BUSINESS_FAX_NUMBER if i don't do any
filtering. So this indicates that i have got the Contacts which has
Business Fax Numbers.
Tks Mita
I am developing a small vb application. I am reading the address
entries from the address list (address list can be any of the address
List) and trying to filter out the names which has Business Fax
number. But it just does'nt work. Can any one tell me, where I am
going wrong.
Your help will be really appreciated.
Private Sub Command1_Click()
Dim objCdo As MAPI.Session
Dim objFolder As MAPI.Folder
Dim objAddressList As MAPI.AddressList
Dim objAddressLists As MAPI.AddressLists
Dim objFilter As AddressEntryFilter
Dim objAddressEntries As MAPI.AddressEntries
Dim objAddressEntry As MAPI.AddressEntry
Dim ctr As Integer
Dim s As String
Set objCdo = CreateObject("MAPI.Session")
objCdo.Logon
Set objFolder = objCdo.Inbox
Set objAddressList = objCdo.AddressLists.Item("Contacts")
Set objAddressEntries = objAddressList.AddressEntries
ctr = objAddressEntries.Count ( I get ctr = 36)
Set objFilter = objAddressEntries.Filter
objFilter.Fields.Add CdoPR_BUSINESS_FAX_NUMBER, "BusinessFaxNumber"
' HERE I GET MAPI_E_TOO_COMPLEX
ctr = objAddressEntries.Count
End Sub
'I can get hold of the CdoPR_BUSINESS_FAX_NUMBER if i don't do any
filtering. So this indicates that i have got the Contacts which has
Business Fax Numbers.
Tks Mita