How come I'm getting 0 address entries when I have many people in my contacts list already?
VB Code:
Private Function EMail_Test() As Long Dim Outlook As Object Dim MAPI As Object Dim Entries As Object Dim Address_Lists() As String Dim Number_Of_Address_Lists As Long Dim Current_Address_List As Long Dim Number_Of_Entries As Long Set Outlook = CreateObject("Outlook.Application") Set MAPI = Outlook.GetNameSpace("MAPI") Number_Of_Address_Lists = MAPI.AddressLists.Count For Current_Address_List = 1 To Number_Of_Address_Lists ReDim Preserve Address_Lists(Current_Address_List) As String Address_Lists(Current_Address_List) = MAPI.AddressLists(Current_Address_List) Set Entries = MAPI.AddressLists(Current_Address_List) Number_Of_Entries = Entries.AddressEntries.Count MsgBox Number_Of_Entries Next Current_Address_List End Function





Mark Thread Resolved
Reply With Quote