I have this code within a module that emails specific reports to client. The code calls a function that opens up Outlook, calls a wait function and waits 20 seconds for Outlook to send/receive. It then sends an email with one report, waits 3 seconds, then another, and another, and Outlook does an automatic send/receive before exiting. The problem is all these emails are going to the same person.
What I would like to do is make it so that all three reports, are sent in the same email. I have tried various combinations of the code and they all fail. This is the code that sends the emails:
OpenOL
WaitSeconds (20)
DoCmd.SendObject acReport, "CustStmt", "PDFFormat(*.pdf)", "rick@kilduff.com", "", "", "CustStmt", "", False, ""
WaitSeconds (3)
DoCmd.SendObject acReport, "CustAdjmts", "PDFFormat(*.pdf)", "rick@kilduff.com", "", "", "CustAdjmts", "", False, ""
WaitSeconds (3)
DoCmd.SendObject acReport, "CustStmt Summary (Roche)", "PDFFormat(*.pdf)", "rick@kilduff.com", "", "", "CustStmt Summary (Roche)", "", False, ""
CloseOL
Any help would be greatly appreciated
1. Use a command line utility such as BLAT.
2. Use software that talks directly to a e-mail server (SMTP) such as vbSendMail
3. Using OLE automation, talk to Outlook and have it send the e-mail.
All three of the above will allow for multiple attachments in a single e-mail. However with that said, that's the other piece of this; you need to run and save the reports to disk first in some format (PDF, Snapshot, etc) before you can send as a single e-mail.
Jim.