I am updating an old program. I noticed in the new build the email send doesn't work.
I searched for the reference. Is there a way of sending without the reference or where is the reference for Outlook 365 (local install)?
I searched for the location. I tried without references.
I lifted this code from examples on the web.
Public Function SendEmail2()
Dim varName As Variant
Dim varCC As Variant
Dim varSubject As Variant
Dim varBody As Variant
varName = "[email protected]"
varSubject = "Hello"
varBody = "Let's go"
DoCmd.SendObject , , , varName, varCC, , varSubject, varBody, True, False
End Function
Error message
Runtime error 2046
The command of action Send Object isn't available now
Here is a complete sub to send e-mails from MS Access using Outlook.