SendObject Formats



I have tested the below code and it works. At least it
works in Access XP and later. An earlier version of
Access is not available to me right now and I don't
remember whether the below "acFormatSNP" constant is
supported in A2K or A97.

Also worth noting is that "acFormatSNP" is not shown in in
AXP's online help for SendObject. However, this constant
is shown in the Object Browser.

Dim strReportName As String

strReportName = "YourReport"

DoCmd.SendObject acSendReport, strYourReport,
acFormatSNP, "(e-mail address removed)", _
, , "It's A Snapshot File!", "See attached report in
snap shot file format.", True




Hi Mike,

Thanks for the reply. I tried it out and haven't received any kind of coding
error however it seems to lock up my app! I'm wondering if it has anything to
do with some security issues with emailing. If you know of any things I could
check, I would appreciate it. I am working in MS Access 2003 on XP Pro. I
have all the latest Office and XP patches, SR's, etc installed.

david epsom dot com dot au

asFormatSNP was not in the first release of A97, but was added
in a service release (probably SR1).



Sorry, my fault. When I ran my test, I made an oversight
and then added to it by renaming one variable instance out
of two, but I think you already figured that part out for
yourself. The oversight was that I excluded one of the
commas from the sendobject statement. The code runs, but
patiently waits for the user to click the Send button in
Outlook. ;-)

Try this instead:

Dim strReportName As String

strReportName = "rptLeverage"

DoCmd.SendObject acSendReport, strReportName,
acFormatSNP, "(e-mail address removed)", , _
, "It's A Snapshot File!!!", , False

Also, Outlook 2003 has a security prompt that will force
the user to click "Yes" in order to allow Access to send
email. If this presents a problem for you, then I know of
two solutions. Just let me know if you need help with
this part.


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