Macro to send multiple reports in a single email

lmur7

New member
Local time
Today, 03:06
Joined
Aug 30, 2007
Messages
2
Hi, I am a beginner MS Access user.

I use 5 "SendObject" actions in a Macro to send 5 reports in .rtf file type (report1.rtf , report2.rtf, etc..) to a recipient. This method results in multiple emails being sent to the recipient.

I am wondering if there is a way to attach all of the reports (*.rtf's) in a single email so that there will be only 1 email sent to the recipient. Any help is greatly appreciated.

Thanks
 
Two options off the top of my head:

1) Zip the five reports and send the zip file using SendObject.

2) Connect to Outlook Object itself, where you can add as many attachments as you want.

Being a beginner, option 2 probably sounds better to you because it is, but you aren't sure how to do it as it's done in VBA. Search this forum for "Outlook Object" and you should be able to come across multiple examples of how to do this.
 
Actually option 1 won't work, as you can't attach the zip file using SendObject, so option 2 is the only one available. Another thing to search for is "Outlook automation".
 
Well, I'll be. I don't really use SendObject (or macros much or even DoCmd.<command> for that matter), but I figured a zip file is technically an object. ;)

Thanks for the head's up.
 
Thanks for the info! I am going to play around with the connection with Outlook and hope that all the programs in MS Office work compatibly with each other.
 
All the MS Office programs talk to each other just fine. You'll find very few inconsistencies. The trick is that the VBA for each program can be slightly different since they are specific to each program. For example, Access easily refers to tables and queries, Excel easily refers to cells and ranges, and Word easily refers to paragraphs and fonts. The core (non-application specific) VBA between all of them is identical though.
 
This subject has been covered many many times. Do a search there are plenty of examples and demo databases that show this.

Col
 

Users who are viewing this thread

Back
Top Bottom