Scheduling Email with Attachment

JMarcus

Registered User.
Local time
Today, 13:15
Joined
Mar 30, 2016
Messages
89
Im exploring running query and sending emails on a scheduled basis to select recipients. Does anyone have experience with this? Is it difficult? Current procedure is to run it with a button. Looking forward to feedback.

Private Sub Command38_Click()


' acFormatHTML, acFormatRTF, acFormatSNP, acFormatTXT, acFormatXLS
' acFormatXLSB, acFormatXLSX, acFormatXPS, acFormatPDF
On Error Resume Next
DoCmd.SendObject acSendTable, "tblPlanTypes", acFormatXLS, , , , "Test", _
"Customers table attached", True
If Err <> 0 Then
MsgBox Err.Description, vbInformation, "Data Not Sent"
End If
End Sub
 
I would create a db that performed the desired process on startup, then quits, and run it from Windows Scheduled Tasks.
 
Good idea. Have you coded it before?
 
I have quite a few automated processes running that way.
 
You mind sharing (1) with me. It would save me so much time.
 
And deprive you of the fun of learning to fish? ;)

Tools you'll need include an autoexec macro. As simple as yours is, you can probably to it all within that macro. I just noticed there's no address; you leave it for the user to fill in?
 
Ok Thanks. I dont see an option with autoexec macro but look into it.
 
Just run it. Makes sense. I should have known it.
 
A macro named autoexec will run on startup, presuming the db is in a trusted location.
 

Users who are viewing this thread

Back
Top Bottom