I am useing the following code to send email reports and I was wondering if there was a way since it knows how the email is going to that it would just send the email without opening outlook and the user having to hit send!
Code:
Private Sub Email_Helpdesk_Report_Click()
On Error GoTo Err_Email_Helpdesk_Report_Click
Dim strText As String
Dim SubjectLine As String
Dim EmailAddress As String
Dim Msg, Style, Title, Response
Dim Capita As String
Dim stDocName As String
stDocName = "Mandatory_Helpdesk_Report"
EmailAddress = "email@email.ca"
Msg = "Do you want to email this to " & EmailAddress & "?"
Style = vbYesNo + vbDefaultButton2
Title = "Email Confirmation"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
SubjectLine = "Help Desk Review"
'DoCmd.SendObject acReport, stDocName
DoCmd.SendObject acReport, stDocName, "RichTextFormat(*.rtf)", EmailAddress, , , SubjectLine, _
"Please log this call and return details to sender." & vbCrLf & vbCrLf & "Internal Reference: ", True
'Err_cmdEmailrptAcademyReport_Click:
'If Err.Number = 94 Then
'MsgBox "Data is incorrect or missing"
'End If
End If
Exit_Email_Helpdesk_Report_Click:
Exit Sub
Err_Email_Helpdesk_Report_Click:
MsgBox Err.Description
Resume Exit_Email_Helpdesk_Report_Click
End Sub