I know this had been addressed before but a.) all the previous posts were specific to a particular problem or the problem was far more comlpex than what I want to do and b.) I'm not very good with VBA, so if it possible to piece together how to to a simple report in the body of an email from the code in previous posts, I was unable to do it.
All I want to do is put a text report into the body of an email. There is no formatting neccessary. The only cavaet, which prevents me from hard-coding text into the body, is the text needs to contain fields. What I haev is this:
A data input form.
A query that pulls some of the fields from the record for the current form.
A report that has some text, with fields from the query inserted, like a form letter. ie. Dear [Employee_Name],
A button on the form to run the email code.
Currently I used a SendOjbect macro to output the report as an rtf attachment and uses one of the fields for the To:, which works fine, but ideally I'd like the text in the body. I was able to code enough (based on the afforementioned posts) to open Outlook, create an email, set the To: to the employee name based on the form, and set the subject line. I just can't figure out the report-in-the-body bit.
Any help is greatly appreciated!
All I want to do is put a text report into the body of an email. There is no formatting neccessary. The only cavaet, which prevents me from hard-coding text into the body, is the text needs to contain fields. What I haev is this:
A data input form.
A query that pulls some of the fields from the record for the current form.
A report that has some text, with fields from the query inserted, like a form letter. ie. Dear [Employee_Name],
A button on the form to run the email code.
Currently I used a SendOjbect macro to output the report as an rtf attachment and uses one of the fields for the To:, which works fine, but ideally I'd like the text in the body. I was able to code enough (based on the afforementioned posts) to open Outlook, create an email, set the To: to the employee name based on the form, and set the subject line. I just can't figure out the report-in-the-body bit.
Any help is greatly appreciated!