Email Report Details into Email Body (1 Viewer)

stu_c

Registered User.
Local time
Today, 00:51
Joined
Sep 20, 2007
Messages
489
Hi all
I have got a report that I view that I would like to be able to Email, currently I have a macro button when clicked goes into a PDF file to Email etc but ideally need it in the body of an Email, I understand I probably need to make an Email template to do this but I have no idea where to even start with this can someone give me some guidance.

Example Database Details
Database Name: ExampleDatabase.accdb

TableName: TBLExampleDetails
ExampleField1 (AutoNumber)
ExampleField2
ExampleField3

QueryName: QRYExampleDetails
ExampleField1
ExampleField2
ExampleField3

ReportName: RPTExampleDetails
ExampleField1 - Send To Email Body
ExampleField2 - Send To Email Body
ExampleField3 - Send To Email Body


Thanks In Advance
 

Isskint

Slowly Developing
Local time
Today, 00:51
Joined
Apr 25, 2012
Messages
1,302
hi stu_c

Would you want to keep the formatting?

Simplest method of achieving this (but loosing formatting) is to output the report as HTML to a temp file, then open up the temp file source code to grab it and pass it along to the body argument of an HTML email that we create within VBA.

If you are a little more adventurous and know a bit of HTML, you may be able to recreate the formatting.

Good example here http://www.access-freak.com/blog2008.html#BlogEntryAugust200802
 

June7

AWF VIP
Local time
Yesterday, 16:51
Joined
Mar 9, 2014
Messages
5,423
Use Outlook automation to build and send email with HTMLbody. Isskint describes one way to generate body content. Another is to loop through recordset and concatenate with HTML code tags to format data into tabular structure. Suitable for simple output. Common topic, many examples.
 

stu_c

Registered User.
Local time
Today, 00:51
Joined
Sep 20, 2007
Messages
489
Hello Isskint
All I need it really is in a table like you would see the data in Access tables really should be fine

hi stu_c

Would you want to keep the formatting?

Simplest method of achieving this (but loosing formatting) is to output the report as HTML to a temp file, then open up the temp file source code to grab it and pass it along to the body argument of an HTML email that we create within VBA.

If you are a little more adventurous and know a bit of HTML, you may be able to recreate the formatting.

Good example here http://www.access-freak.com/blog2008.html#BlogEntryAugust200802
 

Users who are viewing this thread

Top Bottom