tags:

views:

485

answers:

1

I need to create a control that has the same functionality as the Outlook To... button on a new email (i.e. when clicked, a modal dialog is created which holds the entire global address list within a listbox.)

I have no problems accessing this data, I ahve a list of AddressEntries which I want to present in the ListBox, however, due to the size of the data set (~300K records), this is proving very difficult.

I would like to avoid streaming 100 or so records at a time, as outlook does not do this.

Does anyone know of a good way to do this?

If it helps, the code I am using to get the address list is:

public AddressEntries GetGlobalAddressList()
        {
            Outlook.Application oApp = new Outlook.Application();
            Outlook.NameSpace oNS = oApp.GetNamespace("mapi");
            oNS.Logon(Missing.Value, Missing.Value, false, true); 
            Outlook.AddressLists oDLs = oNS.AddressLists;  
            Outlook.AddressList oGal = oDLs["Global Address List"];  
            Outlook.AddressEntry oEntry = default(Outlook.AddressEntry);

            return oGal.AddressEntries;            

         }
A: 

Probally the easyiest you can use CDO CDO's Session.AddressBook(). or use redemption's (http://www.dimastr.com/redemption/) RDO AddressBook if you want to get round the security prompts etc.

Marcus

76mel