G
Guest
Hello, I've read several posts and could use help setting up automation to
send Access data via email.
I have a report named EmailData. The report has the formatting I'd like to
see in the body of the email.
Right now I'm using a form which works to create the email and populate the
Address fields, but currently the body is a .rtf attachment that shows the
address fields. I'd like to see the EmailData report in that section but
need help adjusting my code. Also, I prefer the report to display with
formatting, not as an attachment.
I have a Macro set up to run using a command button on a form as follows:
Form name: frmMail
Private Sub Command72_Click()
On Error GoTo Err_Command72_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "DistroList"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command72_Click:
Exit Sub
Err_Command72_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command72_Click
End Sub
There is a macro attached to the OnOpen event of the DistroList form with
the following code:
Option Compare Database
Option Explicit
'------------------------------------------------------------
' EmailTemplate
'
'------------------------------------------------------------
Function EmailTemplate()
On Error GoTo EmailTemplate_Err
DoCmd.SendObject acForm, "DistroList", "RichTextFormat(*.rtf)",
Forms!DistroList.EmailAddress, Forms!DistroList.CCAddress,
Forms!DistroList.BCCAddress, Forms!DistroList.Subject,
Forms!DistroList.Verbiage, True, ""
DoCmd.Close acForm, "DistroList"
EmailTemplate_Exit:
Exit Function
EmailTemplate_Err:
MsgBox Error$
Resume EmailTemplate_Exit
End Function
I don't know how to get the EmailData report as the body of the email.
Outlook opens and the address fields populate, but I'm having trouble with
the message body. Even if I could have it as an attachment it would help. I
can open it, copy and paste, then send the email. Still much quicker than
what I'm doing now.
Please help me with this last piece of the puzzle.
Thanks!
Mary
send Access data via email.
I have a report named EmailData. The report has the formatting I'd like to
see in the body of the email.
Right now I'm using a form which works to create the email and populate the
Address fields, but currently the body is a .rtf attachment that shows the
address fields. I'd like to see the EmailData report in that section but
need help adjusting my code. Also, I prefer the report to display with
formatting, not as an attachment.
I have a Macro set up to run using a command button on a form as follows:
Form name: frmMail
Private Sub Command72_Click()
On Error GoTo Err_Command72_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "DistroList"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command72_Click:
Exit Sub
Err_Command72_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command72_Click
End Sub
There is a macro attached to the OnOpen event of the DistroList form with
the following code:
Option Compare Database
Option Explicit
'------------------------------------------------------------
' EmailTemplate
'
'------------------------------------------------------------
Function EmailTemplate()
On Error GoTo EmailTemplate_Err
DoCmd.SendObject acForm, "DistroList", "RichTextFormat(*.rtf)",
Forms!DistroList.EmailAddress, Forms!DistroList.CCAddress,
Forms!DistroList.BCCAddress, Forms!DistroList.Subject,
Forms!DistroList.Verbiage, True, ""
DoCmd.Close acForm, "DistroList"
EmailTemplate_Exit:
Exit Function
EmailTemplate_Err:
MsgBox Error$
Resume EmailTemplate_Exit
End Function
I don't know how to get the EmailData report as the body of the email.
Outlook opens and the address fields populate, but I'm having trouble with
the message body. Even if I could have it as an attachment it would help. I
can open it, copy and paste, then send the email. Still much quicker than
what I'm doing now.
Please help me with this last piece of the puzzle.
Thanks!
Mary