PDA

View Full Version : How to use templates sending emails with access



raul
06-29-2017, 05:07 AM
Hi, first of all sorry for my bad english, I have a small database wich runs my warehouse, and i'm having problems with the cba code sending emails.
I have a form for orders, wich creates reports, bills, etc. With some code, i grab the email address and create a new email attaching the report, but i want to attach a templae for the body of the email.
the code i have is :

DoCmd.SendObject acReport, "FacturasCorreo", "PDFFormat(*.pdf)", "" & Me.Correo & "", "", "", "Confirmación envío", "", True, ""

This gives me no problem, but, the last quotation marks stands for templates, and when i paste the route, no matter how i paste it, it doesnt work, anyone know how to use a template for the body of the email? Or if i could use a report or something? Thanks.

OBP
06-29-2017, 01:26 PM
Do you get an error message when you include the template path?
Have you ensured that the Path to the Template is correct?
It will have to exact.

raul
06-30-2017, 12:13 AM
Do you get an error message when you include the template path?
Have you ensured that the Path to the Template is correct?
It will have to exact.
No, it doesnt give me any error, it just launch the email with blank body, i tried to include the path with the ".htm" and replacing "\" for "/" just in case, but nothing works. Could it be problem of the template?

OBP
06-30-2017, 01:49 AM
Unfortunately I have never used Templates, so I can't really comment on that part of it, perhaps HiTech Coach could help with that.
I will PM him.

raul
06-30-2017, 02:00 AM
Thanks, I appreciate that :D

HiTechCoach
06-30-2017, 12:35 PM
raul,

It has been awhile since I used the Docmd.SendObject method.

I think I used VBA code to read the template file into a varient variable. This was used in the MessageText parameter.

I will check my code archive for some exmaples I can post.