Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Including reports in the body of an Outlook email

1,537 views
Skip to first unread message

PW

unread,
Nov 1, 2013, 4:09:30 PM11/1/13
to
Hi,

I currently attach reports to Outlook emails but a client wants the
reports to be inside an email (the body/message section).

Is this possible? I receive emails with what looks like a report in
the message area.

SendObject has a 255 character limit so that won't work.

I am using Access 2010 and Outlook 2010.

Thanks,

-paulw

Patrick Finucane

unread,
Nov 1, 2013, 5:23:19 PM11/1/13
to
I don't see how you can send the report in the body and not as an attachment unless you roll your own. Good luck with the formatting.

David Hare-Scott

unread,
Nov 1, 2013, 6:41:14 PM11/1/13
to
Reports are designed to be printed not viewed on the screen. Accordingly
they use a printer driver to be formatted, this may be for a physical
printer or (say) a PDF or fax. You cannot send a printer stream to an email
and as far as I know you can paste an image, text or HTML into the body of
an email but not a whole PDF. If you are receiving emails that look like
reports I would guess they are HTML. Is there a way to render an Access
report as HTML? Not directly AFAIK - but you can export a report as HTML
and you may be able to find a way to programatically get that into an email.


Of course one has to ask why anybody as a matter of choice would want to
view on the screen a document designed for printing.



D

PW

unread,
Nov 1, 2013, 7:15:22 PM11/1/13
to
Well, there's print preview for viewing reports.

The guy is not going to be happy. He doesn't want to send attachments
and would like his reservation confirmation text from his letter to be
the body of the email instead.

I wonder if the .body property can except HTML if I could ever figure
how to convert an Access report to HTML. Nah.

Thanks,

-paulw

Access Developer

unread,
Nov 1, 2013, 8:13:48 PM11/1/13
to
Have you considered just sending the necessary confirmation information by
e-mail, not an exact reproduction of the Reports you have been attaching?

I continue to be amazed when people lose sight of the actual purpose of
business correspondence and get side-tracked on feeling they must do
something difficult or impossible, as seems to be the case here.

Maybe you could make it "unobvious" by offering a choice of e-mail
confirmation or printable attachment -- not saying "and the e-mail will be
identical in format to the attachment".

--
Larry Linson
Microsoft Office Access MVP
Co-Author, Microsoft Access Small Business Solutions, Wiley 2010

"PW" <emailad...@ifIremember.com> wrote in message
news:65d8791d12p7q0dfi...@4ax.com...

PW

unread,
Nov 1, 2013, 9:53:28 PM11/1/13
to
On Fri, 1 Nov 2013 19:13:48 -0500, "Access Developer"
<accd...@gmail.com> wrote:

>Have you considered just sending the necessary confirmation information by
>e-mail, not an exact reproduction of the Reports you have been attaching?
>
>I continue to be amazed when people lose sight of the actual purpose of
>business correspondence and get side-tracked on feeling they must do
>something difficult or impossible, as seems to be the case here.
>
>Maybe you could make it "unobvious" by offering a choice of e-mail
>confirmation or printable attachment -- not saying "and the e-mail will be
>identical in format to the attachment".

There are custom paragraphs and also calculations in some of the
reports they want to send. Like a "balance due",...

Maybe we can get away with less in the email body and not have them
identical to the reports. I guess I could build a reports table where
they can fill in with what they want each letter to say and read
through and use Automation to fill in the email body. But I don't
know what to do about calculations. Write them to a temp table I
guess.

Thanks Larry! My wheels are spinning now.

-paul

David Hare-Scott

unread,
Nov 2, 2013, 12:23:28 AM11/2/13
to
If Outlook is installed it is simple to compose your own email from Access
using automation. Your calculated values could be done using your own
functions, domain aggregate functions, aggregate querys....

D


Access Developer

unread,
Nov 2, 2013, 1:12:41 AM11/2/13
to
Outlook, because it is so widely used, is a favorite target of spammers,
scammers, and e-mail address theives. I can't be too harsh with those who
avoid it for that reason; but if it is available, it interoperates quite
well with other Office software (as David has said).

At one time, I did a proof-of-concept example for a colleague who was
webmistress of our computer users group website. I included code in the
Print event of a report that would use the report calculations to generate
HTML code with the values and write it to a text file. The report itself was
to be discarded, and the HTML would be automated into source of a web page.
The p-o-c was successful, but the the functionality was soon no longer
needed so it wasn't put into production.

Current office documents output is XML, so something similar ought to work
to create the e-mails.

--
Larry Linson
Microsoft Office Access MVP
Co-Author, Microsoft Access Small Business Solutions, Wiley 2010

"PW" <emailad...@ifIremember.com> wrote in message
news:dhm87991bqjkm6q4s...@4ax.com...

Steve Hayes

unread,
Nov 2, 2013, 2:03:29 AM11/2/13
to
I haven't used Access 2010, but you should be able to design a report in Ascii
test that can be sent to a file. And presumably Outlook has the capability to
import an Ascii file as message text.

--
Steve Hayes from Tshwane, South Africa
Web: http://www.khanya.org.za/stevesig.htm
Blog: http://khanya.wordpress.com
E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

Phil

unread,
Nov 2, 2013, 4:18:06 AM11/2/13
to
On 02/11/2013 06:03:27, Steve Hayes wrote:
> On Fri, 01 Nov 2013 14:09:30 -0600, PW <emailad...@ifIremember.com>
> wrote:
>
>>Hi,
>>
>>I currently attach reports to Outlook emails but a client wants the
>>reports to be inside an email (the body/message section).
>>
>>Is this possible? I receive emails with what looks like a report in
>>the message area.
>>
>>SendObject has a 255 character limit so that won't work.
>>
>>I am using Access 2010 and Outlook 2010.
>>
>>Thanks,
>>
>>-paulw
>
> I haven't used Access 2010, but you should be able to design a report in
> Ascii test that can be sent to a file. And presumably Outlook has the
> capability to import an Ascii file as message text.
>

I do sometig similar to what Paul is lookig for emails. In my version the
email looks soething like Dear XXXX, Your subscription of YYYY is due on ZZZZ

I then have the ability to select a field from a query and substitute say
FirstName for XXXX, what is owed for ZZZZ and some date for YYYY. The matter
is too compex to be handled on the news group as several forms are involved
and bucket loads of code, but it can be done. If you want to persue it
further, it will have to be done by email. When I get back home, I will post
some images on a website, and notyfy the newsgroup.

Phil

Norman Peelman

unread,
Nov 2, 2013, 12:34:31 PM11/2/13
to
This is completely trivial to do:

http://msdn.microsoft.com/en-us/library/office/aa211430(v=office.11).aspx


So at the very least you might have to roll your own HTML output or
you could try 'DoCmd.OutputTo':

http://msdn.microsoft.com/en-us/library/office/ff192065.aspx

And then read the file and create an email from it. Easy enough.


Norm

Patrick Finucane

unread,
Nov 2, 2013, 5:26:48 PM11/2/13
to
On Friday, November 1, 2013 3:09:30 PM UTC-5, PW wrote:
I'm wondering about the Attachment data type introduced in A2007. Lets say it was called Attach. Could code like
x = "Dear Joe: & vbnewline & "The results are " 7 vbnewline & tablename.attach

I can't test on my tablet. Just z thought.

Phil

unread,
Nov 3, 2013, 6:07:51 PM11/3/13
to

PW

unread,
Nov 4, 2013, 12:15:30 PM11/4/13
to
>
>See http://www.flickr.com/photos/107550882@N02/
>
>Phil

That must have taken you alot of work!

I know FMS has "Total Access Emailer" which maybe I should research
again, but it doesn't use Outlook which is what these guys want to
interface with. But I don't think it embeds a report in the body of
an email.

Besides, it's $500 for one developer.

Thanks.

-paulw

PW

unread,
Nov 4, 2013, 1:25:01 PM11/4/13
to
Hi Norm,

I am not sure how to get the criteria/filter when outputting the
report to a file. And then how to read the file and put it all in the
body section/property of Outlook.

Thanks.

-paulw

PW

unread,
Nov 4, 2013, 2:02:50 PM11/4/13
to
On Sat, 02 Nov 2013 08:03:29 +0200, Steve Hayes
<haye...@telkomsa.net> wrote:

>On Fri, 01 Nov 2013 14:09:30 -0600, PW <emailad...@ifIremember.com> wrote:
>
>>Hi,
>>
>>I currently attach reports to Outlook emails but a client wants the
>>reports to be inside an email (the body/message section).
>>
>>Is this possible? I receive emails with what looks like a report in
>>the message area.
>>
>>SendObject has a 255 character limit so that won't work.
>>
>>I am using Access 2010 and Outlook 2010.
>>
>>Thanks,
>>
>>-paulw
>
>I haven't used Access 2010, but you should be able to design a report in Ascii
>test that can be sent to a file. And presumably Outlook has the capability to
>import an Ascii file as message text.

I think only a string can be inserted into the body of an email as in:

.HTMLBody = "<p>This is the first line.</p><p>This is the second
line.</p>"

or

Dim BodyString as String

.BodyFormat = olFormatHTML
.Body = BodyString
.HTMLBody = BodyHTMLString


I found that code at
http://www.utteraccess.com/forum/Send-Email-Message-Body-t1960274.html#!

If it is possible to import a file into the body of an Outlook email,
that would be great. Not sure about the formatting though.

-paulw

Norman Peelman

unread,
Nov 4, 2013, 4:33:08 PM11/4/13
to
Paul,

Once you set the format to olFormatHTML, you can build up 'BodyString'
to be whatever you want:


BodyString = "<HTML><HEAD></HEAD>" _
& "<STYLE>...</STYLE>" _
& "<BODY>" _
& "<P>Firstname: " & Me!FirstName.Value & "</P>"
... etc.
BodyString = BodyString & "</BODY></HEAD>"


Search up how to read a file into a variable (or line by line) if you
want to try to get an existing file into the body. If the file is in
HTML format then the STYLE will control the formatting.


--
Norman
Registered Linux user #461062
AMD64X2 6400+ Ubuntu 10.04 64bit

PW

unread,
Nov 4, 2013, 10:00:47 PM11/4/13
to
Nice! My HTML knowledge is limited but I can study what to do. Or
maybe just plain text for now.

No limit to the size of the string?

Thanks again Norman!

-paulw

Norman Peelman

unread,
Nov 6, 2013, 4:07:02 PM11/6/13
to
Ooops, "</BODY></HTML>"

>>
>> Search up how to read a file into a variable (or line by line) if you
>> want to try to get an existing file into the body. If the file is in
>> HTML format then the STYLE will control the formatting.
>
> Nice! My HTML knowledge is limited but I can study what to do. Or
> maybe just plain text for now.
>
> No limit to the size of the string?

Not sure what the size limit is on any particular string (maybe 2GIGs on
32bit) but I'm assuming you could:

.Body = .Body & "More stuff"

or use multiple string variables like:

.Body = BodyString_Part1 & BodyString_Part2 & BodyString_Part3 ' etc...

PW

unread,
Nov 13, 2013, 12:12:48 PM11/13/13
to
>> No limit to the size of the string?
>
>Not sure what the size limit is on any particular string (maybe 2GIGs on
>32bit) but I'm assuming you could:
>
>.Body = .Body & "More stuff"
>
>or use multiple string variables like:
>
>.Body = BodyString_Part1 & BodyString_Part2 & BodyString_Part3 ' etc...

Hi Norman!

I just got back from a short "vacation" and the first thing I thought
about was how to build the body to look like a letter (including
paragraphs) since there is only one body property as far as I know.
This should help.

Thanks,

-paulw
0 new messages