bpgolferguy
Active Member
- Joined
- Mar 1, 2009
- Messages
- 469
Hi, I have created a button in Access that when clicked I would like it to email the respective report to a group of email addresses. I used the wizard to do this, but I would like it a little more automated. Here is what the code is currently:
After I click the button, it first asks what type of file to send. I always want to send the reports as an .rft file, so if that can be automated into the code that would be great. Next, it opens an email message and attaches the file. What I would like to do here is add a couple of email addresses into the code so they prefill, along with a prefilled subject line and a small message in the body. I still want the email message to show instead of automatically send....just in case something needs to be modified.
Does anyone know how I can change that code to do what I need? Thank you!
Code:
Private Sub Email_Phone_Center_Click()
On Error GoTo Err_Email_Phone_Center_Click
Dim stDocName As String
stDocName = "Phone Center Report"
DoCmd.SendObject acReport, stDocName
Exit_Email_Phone_Center_Click:
Exit Sub
Err_Email_Phone_Center_Click:
MsgBox Err.Description
Resume Exit_Email_Phone_Center_Click
End Sub
After I click the button, it first asks what type of file to send. I always want to send the reports as an .rft file, so if that can be automated into the code that would be great. Next, it opens an email message and attaches the file. What I would like to do here is add a couple of email addresses into the code so they prefill, along with a prefilled subject line and a small message in the body. I still want the email message to show instead of automatically send....just in case something needs to be modified.
Does anyone know how I can change that code to do what I need? Thank you!