Attach Access Object (table, query, report) to Email by Instantiating Outlook?

Anonymous
2014-12-11T21:17:09+00:00

So, I don't want to use the SendObject method.  I want to instantiate Outlook from MS Acces using VBA, but I want to attach a native access query as an Excel file to the email (as can be done using SendObject).  I haven't been able to figure out how to do this.  I'm only able to attached a file stored on a drive using the code in the screen shot below.

Can this be done?  And, if it can, how?

Thank you in advance for you help!

Thanks,

Manuel

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2014-12-12T20:59:38+00:00

    No suggestions?

    0 comments No comments
  2. Anonymous
    2014-12-12T21:36:28+00:00

    You'd first need to export your query results to Excel using a function, such as: http://www.devhut.net/2012/04/19/ms-access-vba-export-records-to-excel/

    then in attach it to your e-mail.  For sample code for this, see: http://www.devhut.net/2010/09/03/vba-html-outlook-automation/

    0 comments No comments