splats
Technical User
- Jan 2, 2003
- 131
Hello
myh code works great with access 2000 however when it is in 2003, it does not work. Any suggestions would be greatly appreciated.
Thank you
Private Sub cmdEmailEmplSum_Click()
On Error GoTo Err_cmdEmailEmplSum_Click
Dim stDocName As String, emailTo As String, emailCC As String, emailBCC As String
stDocName = "Employee Summary of Incidents All"
emailTo = ""
emailCC = ""
emailBCC = ""
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
'MsgBox ("In the next screen, please choose attachment format. Snapshot Format is highly recommended in order to keep formatting of the document.")
DoCmd.SendObject acReport, stDocName, acFormatXLS, emailTo, emailCC, emailBCC, "Safety Database Employee Summary of Incidents All Report", "As attached."
'DoCmd SendObject [ObjectType As AcSendObjectType = acSendNoObject], [ObjectName], [OutputFormat], [To], [Cc], [Bcc], [Subject], [MessageText], [EditMessage]
End With
Exit_cmdEmailEmplSum_Click:
Exit Sub
Err_cmdEmailEmplSum_Click:
MsgBox Err.Description
Resume Exit_cmdEmailEmplSum_Click
End Sub
myh code works great with access 2000 however when it is in 2003, it does not work. Any suggestions would be greatly appreciated.
Thank you
Private Sub cmdEmailEmplSum_Click()
On Error GoTo Err_cmdEmailEmplSum_Click
Dim stDocName As String, emailTo As String, emailCC As String, emailBCC As String
stDocName = "Employee Summary of Incidents All"
emailTo = ""
emailCC = ""
emailBCC = ""
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
'MsgBox ("In the next screen, please choose attachment format. Snapshot Format is highly recommended in order to keep formatting of the document.")
DoCmd.SendObject acReport, stDocName, acFormatXLS, emailTo, emailCC, emailBCC, "Safety Database Employee Summary of Incidents All Report", "As attached."
'DoCmd SendObject [ObjectType As AcSendObjectType = acSendNoObject], [ObjectName], [OutputFormat], [To], [Cc], [Bcc], [Subject], [MessageText], [EditMessage]
End With
Exit_cmdEmailEmplSum_Click:
Exit Sub
Err_cmdEmailEmplSum_Click:
MsgBox Err.Description
Resume Exit_cmdEmailEmplSum_Click
End Sub