Hello,
I'm fairly new to .NET, however, slowly but surely I think I'm getting it. I'm creating an application in VB 2008 express in which I wish to access a Global Address List. After some research I was able to accomplish this, yet the list is so long (several hundred thousand addresses) that it take five minutes just to get through the B's. Is there is simpler and faster way to do this? I'm trying to simulate what happens when one opens the address book in outlook which is almost instant. Any Ideas?
CODE
Dim olal As Microsoft.Office.Interop.Outlook.AddressList
Dim olns As Microsoft.Office.Interop.Outlook.NameSpace
Dim olae As Microsoft.Office.Interop.Outlook.AddressEntry
Dim currentaddress As String
Dim listviewitem As ListViewItem
olapp = GetObject(, "Outlook.Application")
olns = olapp.GetNamespace("MAPI")
For Each olal In olns.AddressLists
currentaddress = olal.Name
If currentaddress = "Global Address List" Then
For Each olae In olal.AddressEntries
With olae
Dim strrecord(4) As String
strrecord(1) = .Name
strrecord(2) = .Class
listviewitem = New ListViewItem(strrecord)
lvwGAL.Items.Add(ListViewItem)
End With
Next
End If
Next
Additionally, the method I'm using does not allow me to access all of the fields within the address entries e.g. email address.