Hello,
When I use this in my module I get an error saying The object type argument for this action or method is blank or invalid. I have to open the table and run the code for it to produce an email. Does anyone know the issue why?
Hello,
When I use this in my module I get an error saying The object type argument for this action or method is blank or invalid. I have to open the table and run the code for it to produce an email. Does anyone know the issue why?
Last edited by MTSPEER; 10-12-2016 at 06:09 AM.
what is your ENTIRE code?
docmd.SendObject acSendTable ,"tblNames",acformatXLS,vTO, ,,vSubj,vMsg
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
Dim strMessage As String
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
strMessage = "Hello," & vbNewLine & vbNewLine & "Please see the attached spreadsheets." & vbNewLine & vbNewLine & "Thank You," & vbNewLine & vbNewLine
DoCmd.SendObject acSendTable, “Manual”, acFormatXLS, "<xyz@gmail.com>", _
"<xyz@gmail.com>", , "Hello" & Date, _
strMessage, True
Set olApp = Nothing
Set olMail = Nothing