Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Emailing attachments to a distribution list

Status
Not open for further replies.

Caryisms

Technical User
Oct 17, 2001
132
US
How can I get this code to send the attachment to all of the email addresses in the Table 1 field strEmail? Right now, it stops after the first address. Thank you.

Public Sub Command0_Click()

Dim otk As Outlook.Application
Dim eml As Outlook.MailItem

Set otk = CreateObject("Outlook.Application")
Set eml = otk.CreateItem(olMailItem)

With eml
.To = [strEmail]
.Subject = "Test Message"
.Body = "This is a test."
.Attachments.Add "C:\test.doc"
.Send
End With

Set eml = Nothing
otk.Quit

End Sub
 
You may consider to play with the Recordset.Clone method or the RecordsetClone property and then browse the so instantiated recordset.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Where would I find the Recordset Clone property?

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top