Export query -> outlook Distribution List

  • Thread starter Thread starter yan
  • Start date Start date
Y

yan

Hello,

I am using Access & Outlook 2000. How can I create a distribution list from
a query in Access?
I have about 50 distribution lists with an average of 50 members. Each time
I import the members into outlook, I am loosing the link between the
distribution list & the contact.... at the same time, some members disapear
from the distribution list, and I am spending to much time to review each
list... wonder if there is a way I could populate distribution list from
Access.

Thank you in advance for your assistance.

Annick
(e-mail address removed)
 
There are several ways to have Access and Outlook interact. Here's one way that worked on my machine (Win 2Kp, Office XP). It's not perfect, because it pops the OL security warning and fails if OL is not already open. You can trap for the latter. To get around the former (if you care), you may be able to use Redemption or CDO, but I'm not sure. Also, the DL only has the recipient's email, and not their name. That could probably be changed if you were referring to an actual OL contactitem. Finally, you need to set a reference to the OL library

Sub createDL(
Dim ola As Outlook.Applicatio
Dim dli As Outlook.DistListIte
Dim myTempItem As Outlook.MailIte
Dim myRecipients As Outlook.Recipient
Dim qryResults As Objec

Set ola = CreateObject("Outlook.Application"
Set dli = ola.CreateItem(olDistributionListItem
Set myTempItem = ola.CreateItem(olMailItem
Set myRecipients = myTempItem.Recipient
Set qryResults = CurrentDb.OpenRecordset("myquery"
If qryResults.BOF Then GoTo exit_createD
qryResults.MoveFirs
D
myRecipients.Add qryResults!emai
qryResults.MoveNex
Loop Until qryResults.EO
dli.AddMembers myRecipient
dli.DLName = "list1

dli.Close olSav
myTempItem.Close olDiscar
exit_createDL
Set myTempItem = Nothin
Set myRecipients = Nothin
Set dli = Nothin
Set ola = Nothin
qryResults.Clos
Set qryResults = Nothin
End Su

Hope this helps

- Scot

----- yan wrote: ----

Hello

I am using Access & Outlook 2000. How can I create a distribution list fro
a query in Access
I have about 50 distribution lists with an average of 50 members. Each tim
I import the members into outlook, I am loosing the link between th
distribution list & the contact.... at the same time, some members disapea
from the distribution list, and I am spending to much time to review eac
list... wonder if there is a way I could populate distribution list fro
Access

Thank you in advance for your assistance

Annic
(e-mail address removed)
 
Back
Top