PC Review


Reply
Thread Tools Rate Thread

Can I create Outlook Distribution List from Access database?

 
 
Jan Main
Guest
Posts: n/a
 
      7th Jun 2010
Is it possible to create a Distribution List from email addresses already
stored in an Access database.
I can send an email to each individual email address listed in the database,
but would like to send the same email to several of the email addresses in
one go.
 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      7th Jun 2010
You don't need (and shouldn't bother with) a distribution list for that.
This can be done with Outlook VBA code that creates a message (CreateItem
method) and sets the To property of the message to a semi-colon delimited
string of the desired addresses.

Note, though, that this means each recipient will see the others' addresses,
which might not be desirable for privacy reasons. Your existing technique,
which I presume is mail merge, might be better for that reason (and because
it requires no code.

Please post follow-up any questions or comments to the forum at
http://social.answers.microsoft.com/...oksend/threads as this
newsgroup will be discontinued any day now.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54



"Jan Main" wrote:

> Is it possible to create a Distribution List from email addresses already
> stored in an Access database.
> I can send an email to each individual email address listed in the database,
> but would like to send the same email to several of the email addresses in
> one go.

 
Reply With Quote
 
New Member
Join Date: Feb 2011
Posts: 1
 
      24th Feb 2011
Quote:
Originally Posted by Jan Main View Post
Is it possible to create a Distribution List from email addresses already
stored in an Access database.
I can send an email to each individual email address listed in the database,
but would like to send the same email to several of the email addresses in
one go.

Here is the code I used to read rows from a table to make an email list.
You will need a table with email addresses with 1 row for each person.
It should have the full email address.
You will need to write a query against the table such as: select * from ……





Public Sub eMailDistro()
DoCmd.SetWarnings False
'**********************************************************

Dim strConn As String
Dim myQueryDef As QueryDef
Dim rst As Recordset
Dim oOApp_001 As Outlook.Application
Dim oOApp_001_B As Outlook.Application
Dim oOMail_001 As Outlook.MailItem
Dim conn As ADODB.Connection
Dim eTotal As Long
Dim distro As String

Set oOApp_001 = CreateObject("Outlook.Application")
Set oOMail_001 = oOApp_001.CreateItem(olMailItem)

'q below just calls all recs from table with emails
Set myQueryDef = CurrentDb.QueryDefs("yourquerywithtablewithemailsl")
Set rst = myQueryDef.OpenRecordset(, dbOpenDynaset)


'This DCOUNT will count the number of records and put it in eTotal
eTotal = DCount("yourfieldwithemailaddresses", "yourtablewithemailaddresssl")

'Sets the email distro to blank
distro = ""

'Starts a for loop for the number of email addresses in the table
For i = 1 To eTotal
'concats each name together with ;
distro = distro & ";" & rst.Fields("yourfieldwithemailaddress")
'In the loop, need to move to the next record to concat email address
'If trys to move pass last rec, then cause error, so checked for last rec before moving
If i <> eTotal Then
rst.MoveNext
End If


Next i



With oOMail_001
‘now use the variable disto with all the email names in the to field of outlook
.To = distro
.Body = "Please find attached."

Etc……………….
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using VBA in Access to Create an Outlook Distribution List (Office 2007) Don Microsoft Access Form Coding 4 31st Jul 2008 12:45 AM
Using VBA in Access to Create an Outlook Distribution List (Office 2007) Don Microsoft Outlook VBA Programming 4 31st Jul 2008 12:45 AM
How do I create an Outlook distribution list from an Access table =?Utf-8?B?Sm9uIFNsYWNr?= Microsoft Outlook Contacts 4 12th Jul 2006 11:27 AM
How do I create an Outlook distribution List from an Access Table =?Utf-8?B?bmFjb2ZmZWU=?= Microsoft Access Database Table Design 1 5th Apr 2006 12:37 AM
Create an Outlook email distribution list from an Access table =?Utf-8?B?TWlh?= Microsoft Access 1 17th Feb 2004 06:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:39 PM.