I can't send an Access report via email using DoCmd.SendObject ac.

G

Guest

When I send a report via email using a command button the following code
runs. This code works on some XP machines and not others.

DoCmd.SendObject acReport, stDocName, "html"

When it doesn't work the error message is

"***** can't send this format in a mail message"

where ***** is the access program name.

Note if you take the "html" off and allow a prompt box to come up and then
select 'HTML' it works.
Also if you change it "html" to "rtf" it works.

Has anyone seen this before.
 
D

Dan Artuso

Hi,
I'm not sure why it works at all because the format argument should be a constant.
Here's the snippet from Help:

outputformat One of the following intrinsic constants:
acFormatHTML
acFormatRTF
acFormatTXT
acFormatXLS
If you leave this argument blank, Microsoft Access prompts you for the output format.

Note that these equate to numbers, not strings.
 
G

Guest

Thanks for that, my mistake, works fine now

Dan Artuso said:
Hi,
I'm not sure why it works at all because the format argument should be a constant.
Here's the snippet from Help:

outputformat One of the following intrinsic constants:
acFormatHTML
acFormatRTF
acFormatTXT
acFormatXLS
If you leave this argument blank, Microsoft Access prompts you for the output format.

Note that these equate to numbers, not strings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top