dt01pqt
04-06-2004, 02:15 AM
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.
Private Sub impFrom_Change()
snip
For Each ole In ola.Session.AddressLists(impFrom.Value).AddressEnt ries
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
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.
Private Sub impFrom_Change()
snip
For Each ole In ola.Session.AddressLists(impFrom.Value).AddressEnt ries
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