Multiple Email Recipients

G

Guest

Hi all

Can the following code be changed to email to a list of users? Can a
distribution group be picked up from within Outlook contacts or would I have
to store the email addresses in an Access Table and concatenate them somehow?

Public Sub MailIt(strContactName As String, strFile As String)
Dim objOutLook As Outlook.Application
Dim objMail As Outlook.MailItem
Dim objContact As Outlook.Recipient

Set objOutLook = New Outlook.Application
Set objMail = objOutLook.CreateItem(olMailItem)

With objMail
.To = strContactName
.Subject = "RE: some subject line"
.Attachments.Add (strFile)
.Display
End With

Set objMail = Nothing
Set objOutLook = Nothing
End Sub

Thanks in advance for any help.
Sue
 
D

David C. Holley

If you're not using a Distribution list, just use the email address
separated by a semicolon ";". For the distribution list, it should be
just a matter of using the NAME of the distribution list.
 
G

Guest

(I am using Windows XP and Access 2000.) I have a module set up to send
e-mail. I, too, would like to create a distribution list from a recordset in
order to send a message to multiple recipients. The recordset changes
constantly because of all the subforms used in the query that I will use as
the recordset. Thus, I need to know how to add the distribution list to the
Access module.

I cannot tell if I need to use the olDistributionList in OlObjectClass or
the olDistributionListItem in olItemType or both???

Any guidance would be appreciated. Thanks in advance. --Linda
 
G

Guest

Never mind to previous post. I figured it out.

I used Dim strRecips As String, inside the modulewith all my other info,
while also setting a reference to the recordset that holds the e-mail
addresses (I stripped the extra stuff from the e-mail addresses so that it
contains only the HyperlinkPart,1). Then I looped through the recordsets.
When I got to the .To field, I put strRecips. It works GREAT.

I hope this helps someone else.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top