G
Guest
I am using the following which is called in a cmdBtn sub
Private Sub SendEmail()
On Error GoTo Err_SendEmail
Dim strEmail1 As String
Dim strMailSubject As String
Dim strMsg As String
Dim strDoc As String
strDoc = "Flight_Summary_for_Flight_" & FlightID.Value
strEmail1 = "(e-mail address removed)" & vbNullString
strMailSubject = "Flight Summary for Flight " & FlightID.Value
strMsg = "I am attaching the latest Flight Summary Report."
DoCmd.Rename strDoc, acReport, "rptForEmail"
DoCmd.SendObject acSendReport, "Flight_Summary_for_Flight_" &
FlightID.Value, acFormatSNP, strEmail1, , , strMailSubject, strMsg,
True
DoCmd.Rename "rptForEmail", acReport, strDoc
Exit_SendEmail:
Exit Sub
Err_SendEmail:
MsgBox Err.Description
Resume Exit_SendEmail
End Sub
This does indeed change the name of the report, but does not change the name
in the email attachment. So I am thinking I need to change the caption, but
can't find the right syntax.
Teach me to fish! Thanks for the help.
Pax, M
Private Sub SendEmail()
On Error GoTo Err_SendEmail
Dim strEmail1 As String
Dim strMailSubject As String
Dim strMsg As String
Dim strDoc As String
strDoc = "Flight_Summary_for_Flight_" & FlightID.Value
strEmail1 = "(e-mail address removed)" & vbNullString
strMailSubject = "Flight Summary for Flight " & FlightID.Value
strMsg = "I am attaching the latest Flight Summary Report."
DoCmd.Rename strDoc, acReport, "rptForEmail"
DoCmd.SendObject acSendReport, "Flight_Summary_for_Flight_" &
FlightID.Value, acFormatSNP, strEmail1, , , strMailSubject, strMsg,
True
DoCmd.Rename "rptForEmail", acReport, strDoc
Exit_SendEmail:
Exit Sub
Err_SendEmail:
MsgBox Err.Description
Resume Exit_SendEmail
End Sub
This does indeed change the name of the report, but does not change the name
in the email attachment. So I am thinking I need to change the caption, but
can't find the right syntax.
Teach me to fish! Thanks for the help.
Pax, M