Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code for Sending an Email Automatically From Access 1

Status
Not open for further replies.

mike1975

IS-IT--Management
Jun 26, 2001
38
GB
Hi,

I am trying to get Access to send an e-mail on a certain day of the week automatically. I have written the code as follows;

DoCmd.SendObject acSendReport, "Support Request Log Query", acFormatSNP, "Mike Harris; Julia Berry", , , "Pending Report", , , False

This does not send the mail but allows me to edit it before I send it and I want it to go automatically. I thought the false statement at the end determined this.

Also if I wanted this to go on a Friday for example could anyone show me the code to do this - I know you would need to use the DayDate function but I am not sure how to build this into the code.

Mike :)
 
DoCmd.SendObject acSendReport, "Support Request Log Query", acFormatSNP, "Mike Harris; Julia Berry", , , "Pending Report", , False

you put the last parameter (FALSE) to wrong space.
with your command "you want to use as a template for an HTML file."

Syntax
DoCmd.SendObject [objecttype][, objectname][, outputformat][, to][, cc][, bcc][, subject][, messagetext][, editmessage][, templatefile]


ide
 
Thanks Ide,

DoCmd.SendObject acSendReport, "Support Request Log Query", acFormatSNP, "mikeharris", , , "Pending Report", False

I have changed the code to this however I still get the chance to edit the mail before it goes - I just want it be sent when outlook does a send and recieve.

Mike
 
DoCmd.SendObject acSendReport, "Support Request Log Query", acFormatSNP, "mikeharris", , , "Pending Report", ,False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top