Code:
Set ola = CreateObject("Outlook.Application")
For n = 1 To ola.Session.AddressLists.Count
strAddresslists = strAddresslists & "'" & ola.Session.AddressLists.item(n) & "';"
Next n
impFrom.RowSource = strAddresslists
Code:
Private Sub impFrom_Change()
snip
For Each ole In ola.Session.AddressLists(impFrom.Value).AddressEntries
snip
1. It is not using a property like if you could do AddressLists(index).name but rather the function AddressLists.item(index).
2. Making the retrieval slower than you would expect.
3. Also the dialogue between outlook during this causes it to flash up several times on the windows taskbar (one for each addresslist). This is not at all desirable.
To fill in. The import address form is used to retrieve address names and other info, which is then used on the data entry, data view/edit forms of my database.
I'm sure there is a better solution as I botched this together using what I could see would work in the object browser.
Thanks.
pt