0
votes

I have a query called DepartmentEmailList that has the names and email addresses of all staff and students in the department. The first column, MailingName, contains the first and last names of everyone. The second column, Email, contains their email addresses.

I would like to send everyone an email through Outlook 2007. Ideally I would have a button on a form in Access that opens up Outlook and inserts the email addresses. I've done a bit of research online and can't find anything that seems to work for this situation. I don't want to attach a report, table, or query from Access; I just want to send everyone on my query an email.

Aside from copy/pasting the email column into Outlook manually, does anyone have a solution for this?

Thank you in advance for your help.

1

1 Answers

0
votes

DoCmd.SendObject accepts an argument acSendNoObject, furthermore, the reference page includes sample coding for sending emails via Outlook, which could easily be adapted. You can iterate though your recordset and send an email to each address.

Syntax:

DoCmd.SendObject ObjectType, ObjectName, OutputFormat, To, _
   Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile

You can also generally use FollowHyperLink to make an email clickable:

FollowHyperlink "mailto:[email protected]"