Send email from acceess with outllok templates

G

Guest

I have an Access 2000 database running on XP Pro workstations with Office
2003 or Office 2000 (Access/Outlook 2003 or Access/Outlook 2000).

The Access 2000 application has many "send email" functions invoked from
command buttons, using SendObject. In some instances, the email messages
have attachments created from the database, some simply pop-up a new message
dialog box. In all instances the To: email address is pre-filled from the
Access database. All of these buttons function as desired, except for one
thing:

I would like to be able to use different email templates for the messages
invoked by the command buttons, so that signatures could be included, for
example. Or different pre-formatted messages with customised message body
text.

How is this done?

I have assumed the 'template' parameter at the end of the SendObject would
call in a specific Outlook message form/template. But it seems not, or I'm
doing something wrong.

Partner NewGroups has advised this assumption is incorrect and recommended posting nto MSDN
 
M

Michael Curry

alanm said:
I have an Access 2000 database running on XP Pro workstations with Office
2003 or Office 2000 (Access/Outlook 2003 or Access/Outlook 2000).

The Access 2000 application has many "send email" functions invoked from
command buttons, using SendObject. In some instances, the email messages
have attachments created from the database, some simply pop-up a new message
dialog box. In all instances the To: email address is pre-filled from the
Access database. All of these buttons function as desired, except for one
thing:

I would like to be able to use different email templates for the messages
invoked by the command buttons, so that signatures could be included, for
example. Or different pre-formatted messages with customised message body
text.

How is this done?

I have assumed the 'template' parameter at the end of the SendObject would
call in a specific Outlook message form/template. But it seems not, or I'm
doing something wrong.

Partner NewGroups has advised this assumption is incorrect and recommended posting nto MSDN


One of my projects uses the following code to generate an email
message, lookup up the email address in table, create a subject and
body based on DLookup & what is selected on a form.

Private Sub cmd_Email_Report_Click()
On Error GoTo Err_cmd_Email_Report_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70

MsgBox "Remember to attach LFG results to email message!"

Dim stDocName As String
Dim varEmail As Variant
Dim varSubject As Variant
Dim varAuthor As Variant
Dim varIncidentDate As Variant

stDocName = "rpt_Email_Notification"
stSubject = "Landfill Gas"

varEmail = DLookup("SupervisorEmail", "qry_get_email_address",
"SupervisorID" = Me!SupervisorID)

varSubject = DLookup("SiteName", "tbl_Site", "SiteID = " _
& Forms!frm_technicians_notify!Combo29)

varAuthor = DLookup("Name", "tbl_Employee", "EmployeeID = " _
& Forms!frm_technicians_notify!Combo25)

varIncidentDate = DLookup("IncidentDate", "tbl_Notification",
"NotificationID = " _
& Forms!frm_technicians_notify!NotificationID)

If IsNull(varEmail) Then
MsgBox "Can't send e-mail; no address in Supervisor table!"
Else
DoCmd.SendObject acReport, stDocName, acFormatSNP, _
varEmail, , , _
varSubject & " Notification Report " & varIncidentDate, _
"Please find attached the " & varSubject & " trigger level and
borehole damage notification report for " & varIncidentDate & ". " &
varAuthor, True
End If

Exit_cmd_Email_Report_Click:
Exit Sub

Err_cmd_Email_Report_Click:
MsgBox Err.Description
Resume Exit_cmd_Email_Report_Click

End Sub


Hope that helps

Michael
 

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