[AccessD] Writing HTML to Outlook (2nd try)

Dan Waters dwaters at usinternet.com
Sat Feb 26 11:01:26 CST 2005


And the Main point is: Snapshot Format will include ALL the graphics on the
report.

Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Saturday, February 26, 2005 10:48 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Writing HTML to Outlook (2nd try)

Hello again Arthur!

Well, I had never tried to send a report using HTML for the format, but when
I did I also lost all the graphics.

When I send a report as an email attachment I use Snapshot format.  The
variable for this is acFormatSNP, even though it's not listed in Help.

So, you can use this as the code line:

Do While 'not finished'
    DoCmd.SendObject acSendReport, "rptMyReport", acFormatSNP, _
        "name1 at ISP.com; name2 at ISP.com", , , _
        "Report Name", , False
Loop

There is a trick to getting this to work right.  When you call this line of
code, the report will 'open', but will need to know what to display, or what
record to show.  Otherwise your SendObject code will have one attachment for
each record in the table and would probably error out.  You must code this
into the Report_Open() event for the report.

What I do is have a form already open and it is displaying say record 200
from the table.  When the report opens, whether it's being sent or previewed
or printed, the report is filtered to the record for that form which in this
example is record 200.  You could set up other ways for the report to be
displayed correctly when it is 'opened' by the SendObject command.  This
works for sending a single email with a report attached.

A significant benefit here is that a report in Snapshot format is probably
10% of the size of the same report in pdf.

A drawback is that the receiver must have Access or Snapshot Viewer on their
PC.  When I send out these emails, I include a link to the Snapshot Viewer
download page in the body of the email.

I sure hope you can loop this code hundreds of times instead of your user
having to transform reports manually!

Best of Luck!
Dan Waters
ProMation Systems


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Saturday, February 26, 2005 9:52 AM
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] Writing HTML to Outlook

Arthur,

Would something like this work out?

DoCmd.SendObject acSendReport, "rptMyReport", acFormatHTML, _
    "name1 at ISP.com; name2 at ISP.com", , , _
    "Report Name", , False

This is modified from Access VBA Help.

Dan Waters
ProMation Systems


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Saturday, February 26, 2005 9:13 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Writing HTML to Outlook

Does anyone know how to convert an Access report to HTML and then embed 
it in an Outlook message? Actually there are two problems.

1. When I save a report to HTML, I lose all its graphics.
2. I don't know how to embed the result in an Outlook message.

Currently my user is saving to a PDF, then loading Adobe and opening the 
PDF, then saving it as HTML, then copying and pasting the result into an 
Outlook message. It works, but it's tedious, espcially given that when 
he needs to do it, he does it several hundred times in succession.

TIA,
Arthur

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list