Export report directly to emailbody instead of an attachment?

U

Umberto

Does someone know how I can export a template directly to an Emailbody
instead an attachment like .rtf, .xls, snapshot ?
Many thanks
 
D

Daniel

To quote one of our MVPS:

"To create a formatted document to send as an email you will need to
use VBA code to create a largish string. This string will then be
passed to the SendObject command or other method as the body of the
email. For more details including sample air code see my Tips page
on this topic at http://www.granite.ab.ca/access/email/formatted.htm.


For a page on how to print a report for a single record and how to
generate reports to attach to emails see the Emailing reports as
attachments from Microsoft Access page at
http://www.granite.ab.ca/access/email/reportsasattachments.htm" - Tony
Toews, Microsoft Access MVP
 
U

Umberto

Thank you Daniel
The first method is responding to me.
Do you have a sample code for me of the SendObject command ?
Note : I don't like the include the template as an attachment.
thanks
Umberto
 
D

Daniel

Look it up in the VBE Help.

You'll see an example:
Basic Synthax
DoCmd.SendObject(ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject,
MessageText, EditMessage, TemplateFile)

Functional Example
DoCmd.SendObject acSendTable, "Employees", acFormatXLS, "Nancy Davolio;
Andrew Fuller", "Joan Weber", , "Current Spreadsheet of Employees", , False
--
Hope this helps,

Daniel P
 
U

Umberto

Daniel
For the moment I'm using this code , but the objectName is always attached
as an attachment joining the email ( acFormatXLS, acFormatRtf, ...etc )

I'm looking for a solution where i can send the content or template directly
as an email ( no attachments at all )
Thanks again
Umberto
 
Top