By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,504 Members | 1,231 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,504 IT Pros & Developers. It's quick & easy.

Emailing Reports

P: 7
I'm using the following code in an attempt to email reports from a database form in Access.
Expand|Select|Wrap|Line Numbers
  1. With EMsg
  2. Set .Configuration = EConf
  3. .To = Recip (variable)
  4. .CC = "Susan.Miller@ocfl.net"
  5. .From = "Susan.Miller@ocfl.net"
  6. .Subject = "Please read: Test CDO message with Attached Reports"
  7. .HTMLBody = strHTML
  8. .addattachment (stDocName)
  9. .send
  10. End With
  11.  
As long as the value of stDocName = nothing the email will work but will send a dat file (blank). If I assign a value (Report Name) to stDocName I get an error that reads Run-time Error '-2146697203 (800c000d)'; Specified protocol is unknown. Has anyone encountered this before or have any idea how to correct?

Thank you,
Keriana
Jan 4 '08 #1
Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,316
Please use code tags.


You can't attach the report object as an attachment. It has to be a file. So you must first export the report to a file and then attach the file.
Jan 4 '08 #2

MMcCarthy
Expert Mod 10K+
P: 14,534
Please use code tags.


You can't attach the report object as an attachment. It has to be a file. So you must first export the report to a file and then attach the file.
You can export it in snapshot form which will retain all formatting etc.
Jan 8 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.