Hi, All --
I've searched through the forum (and several others) to try and get some idea of how to go about generating an e-mail which contains a .pdf report -- specifically, a purchase order.
I've found several threads which reference this, but I can't seem to figure out how to adapt the advice in them to my own ends.
Most of the posts I've seen involve first creating a .pdf from a report and then e-mailing it with the DoCmd.SendObject command.
The thing is that the Access-based application I'm using already has a module that runs a report that generates purchase orders as .pdf files. Basically, it looks for a parameter in the "Supplier Information" table which tells it to a) Send the report to a printer for mailing/faxing, b) create a .pdf to be saved, or c) fax the report to a supplier automatically. I really, really don't want to mess around with the code that creates the POs.
I had a thought that I could add a DoCmd.SendObject line into the OnOpen Event of the "b)" report (the one that creates a .pdf).
This way, I wouldn't have to muck around in the module itself and possibly screw it up (it's about 10 grades above my level). Unfortunately, when I tried that, it produced a Run-time error 2585: This action can't be carried out while processing a form or report event.
I guess what I'm looking for is a way to take the report that the module generates, and modify it so that instead of creating a .pdf to be saved, it sends it to an Outlook email; lather, rinse, repeat through all suppliers for whom POs need to be generated.
Any thoughts on how I can make this happen from the report end, rather than the module? I hope I'm articulating this all right. I had hoped to post the module code, but as it turns out I can't even find the lines that call the report.
As always, any insight would be most welcome
I've searched through the forum (and several others) to try and get some idea of how to go about generating an e-mail which contains a .pdf report -- specifically, a purchase order.
I've found several threads which reference this, but I can't seem to figure out how to adapt the advice in them to my own ends.
Most of the posts I've seen involve first creating a .pdf from a report and then e-mailing it with the DoCmd.SendObject command.
The thing is that the Access-based application I'm using already has a module that runs a report that generates purchase orders as .pdf files. Basically, it looks for a parameter in the "Supplier Information" table which tells it to a) Send the report to a printer for mailing/faxing, b) create a .pdf to be saved, or c) fax the report to a supplier automatically. I really, really don't want to mess around with the code that creates the POs.
I had a thought that I could add a DoCmd.SendObject line into the OnOpen Event of the "b)" report (the one that creates a .pdf).
Code:
DoCmd.SendObject acSendReport, , acFormatPDF, , , , "PO From Action", "Hello, this is a Purchase Order", True
I guess what I'm looking for is a way to take the report that the module generates, and modify it so that instead of creating a .pdf to be saved, it sends it to an Outlook email; lather, rinse, repeat through all suppliers for whom POs need to be generated.
Any thoughts on how I can make this happen from the report end, rather than the module? I hope I'm articulating this all right. I had hoped to post the module code, but as it turns out I can't even find the lines that call the report.

As always, any insight would be most welcome