Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,086 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,777 people online right now. Registration is fast and FREE... Join Now!




Slow reading GAL enries

 
Reply to this topicStart new topic

Slow reading GAL enries

emcroom
4 Jun, 2008 - 07:09 AM
Post #1

New D.I.C Head
*

Joined: 28 May, 2008
Posts: 1

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.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 11:47PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month