Smoother way to get address list names from Outlook? (1 Viewer)

dt01pqt

Certified
Local time
Today, 09:39
Joined
Mar 22, 2004
Messages
271
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
I put the above code in the import addresses form on load which is purely designed to retrieve each entry item from the address entries collection using the impFrom dropdown to determine the addresslist. E.g.
Code:
Private Sub impFrom_Change()
snip
For Each ole In ola.Session.AddressLists(impFrom.Value).AddressEntries
snip
Where ole is your address entry item. Before it was fine because the address list was fixed but now I want to offer the choice it has the following problems:

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
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:39
Joined
Feb 19, 2002
Messages
43,484
You can link to many Outlook tables. Files/Get External Data/Link - choose the Exchange() recordsource.
 

dt01pqt

Certified
Local time
Today, 09:39
Joined
Mar 22, 2004
Messages
271
Pat Hartman said:
You can link to many Outlook tables. Files/Get External Data/Link - choose the Exchange() recordsource.
Cheers. Need to download a free add-on first for 97 in order to link with exchange. Works ok in 2000.
 

Users who are viewing this thread

Top Bottom