Send to Email message

SueBK

Registered User.
Local time
Today, 21:15
Joined
Apr 2, 2009
Messages
197
As part of my database I have a table in which I keep a bunch of proforma email messages. It's very simple with 5 fields: an ID, receipient, purpose, subject line, body of text.

Can I program Access to send the standard text to an email message?

eg: I have hundreds of projects, some of which require external advice from a government department. My email proforma says (eg) "For Project <<ABC>> we have made a preliminary determination of <<xyz/not xyz>>. Please confirm our detemination."

Going through an email message and choosing the appropriate option of "xyz" or "not xyz" is not an issue; I would prefer to do that step manually. However, I would love to be able to push a code button that creates a new email message with the appropriate recepient; dumps in the standard text; AND the project details.
 
Have a look at the DoCmd.SendObject Method.

You Could do something along the lines of;
Code:
    Dim stDocName As String
    Dim stEmailAdd As String
    Dim stCCEmail As String
    Dim stSubject As String
    Dim stEmailMessage As String

    stDocName = "RPT_YourReportName"
    stEmailAdd = "SomeOne@Gmail.com"
    stCCEmail = "SomeOneElse@Gmail.com"
    stSubject = "Email Subject in Here"
    stEmailMessage =[COLOR="Green"] 'Put a procedure here to select the appropriate message text, you can do the same for any other of the variables[/COLOR]

    DoCmd.SendObject acReport, stDocName, acFormatSNP, stEmailAdd, stCCEmail, , stSubject, stEmailMessage, True
 

Users who are viewing this thread

Back
Top Bottom