Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Put Access Report in the body of email 2

Status
Not open for further replies.

rgreen511

Technical User
Aug 22, 2005
24
0
0
US
I'd like to put an access report, or alternatively an Access Query into the body of an email.

The SendObject Macro option works very well for attaching the report or query to an email, but I'd very much like to have the contents in the body of the email.

I can accomplish this by running the query, which shows the data table, Ctrl-A (select all) and Ctrl-C (copy), open an email, and choose paste.

I'd like this exact result to happen automatically. Thanks in advance.
 
Have you looked at the
Set objMessage = CreateObject("CDO.Message")
way of sending emails. You can query like you mentioned earlier and then loop through the query and post the information in the body of the email. This will not import the report but it will give you the same results (I think ) as you are getting now without having to copy and paste
If you want more info or cannot find anymore on this method post back and I will help with what I can.

ck1999
 
Here are some links:

Access Report as Email Body
thread705-1114129
Email problem
thread181-1091473
Access SendObject outlook email?
thread702-1114426
 
Thanks for both of these posts. I tried some of the items in the second post's links, but I need to work out some of the bugs. I've tried to write code to export the query to RTF, then use this code to re-import it into an email, to no success, but I'm going to give it some more effort.

I've also seen some previous examples along the lines shown in the first post, so I need to research some other examples. This may be more than sufficient as well. Either of these methods may give me what I'm looking for. Thanks for the replies.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top