eMailing PDF files as attachments from Access

P

Piri

Access 97
I am presently using Access 97 to email out daily reports in RFT
format using:
DoCmd.SendObject acReport, "rptDailyReport", "RichTextFormat(*.rtf)"
etc......

These are individual reports sent to multiple recipients from a
dedicated PC using Outlook Express (to get away from the Outlook
security issue) and it is working very well.

What I would like to do is change to PDF format to preserve report
layouts and images. Is it possible for Access97 to do in PDF what it
is presently doing in RTF? If not, I was thinking of using say CutePDF
to create the PDF file, and then email that file. Is there a way to
email a file as an attachment from within Access?
Upgrading Access is not an option at this stage.

Thanks for your help.
 
P

Piri

Thanks Daniel,
To reiterate, we have been running an Access97 report generating over
100 reports per day each to a different recipient. These are end-of-
day work-in-progress reports that we send out in RTF format. The
creating and sending has been very reliable. But they are not the
easiest to manage from a format conversion angle, as RTF does not deal
with lines, rectangles and images etc., from the Access reports. But
they do the job albeit a bit rough. PDF really is the answer, mainly
because it preserves the original report in looks and format, and it
is a more universally acceptable file format than RTF.

I have now tried Stephen Leban's PDF conversion code (the Access97
version) which he kindly sent me some time ago. It works okay, and
coupled with Outlook 97 I am able to convert the Access report to PDF
and email it out seamlessly (using the code offered by Microsoft -
http://support.microsoft.com/default.aspx?scid=kb;en-us;161088 - and
it is very quick. But........

It is creating memory problems.
To start with I am trialling this on an older PC at home that is
running Win98SE and Office97 - all updates and patches in place. The
actual business PC that runs these reports is an XP SP2 PC with Office
97 etc. I am not sure whether that is the issue I am having right
now. I am assuming it is Steven's code because the errors seem
generated within his procedures before the Outlook routine. I run the
procedure say 10 times and I get the following error message:
MSAccess:2052 There is not enough memory to update the display. Close
unneeded programs and try again."
By stepping through the procedures there seems no set pattern to the
trigger. It has given the same message but headed:

MSAccess:2004
- this error occurs on the line -
' Export the selected Report to SnapShot format
DoCmd.OutputTo acOutputReport, RptName, "SnapshotFormat(*.snp)", _
strPathandFileName

It seems to occur at other points in the code as well.
Ultimately it stops any applications from loading and requires a
reboot of the PC.
I understand from earlier posts there may have been memory issues with
Stephen's code relating to the two extra files required for his code:
I have the following:
DYNAPDF.DLL 2036kb 9/02/06 02:22 Version 2, 0, 10, 180 DynaPDF
2.0
StrStorage.dll 88kb 22/03/06 02:13 No version info available.

Any ideas gratefully appreciated.

Piri
 
S

Stephen Lebans

Piri there are no memory or resource issues with my code. I went out of my
way to personally Email you an A97 conversion of my A2KReportToPDF. My
repayment is you posting in the NG that my code is not only a resource hog
but causes the user to have to reboot.

If you have images in your report then it is a well known Access resource
issue. You need to turn off the Loading Image dialog via the Registry. I
have posted this info many times in the NG's. Use GoogleGroups to find it.

If you do not use Images in your report then you are either:

1) Opening your reports to be exported but failing to close them in your
inner loop.

or

2) Not implementing correctly my sample code or the MS Outlook code you
mentioned.

or

3) You do not have a valid local printer driver, or an output filename
containing illegal characters, and Access is failing to export your report
to Snapshot format.


--

Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
P

Piri

I was not intending to offend to infer that your code was a resource
hog.
I was asking for help to resolve an issue that, for me, seemed to
occur when running your code in my particular project. I was not
intending to criticise - I fully expected to be told I was doing
something wrong. I took on board the matter of the previous DLL memory
bug reported on your web site and couldn't figure out where I was
going wrong. If anyone takes it any other way then I apologise - I
respect and appreciate your help. I am not a professional programmer.

Your advice regarding images being " a well known Access resource
issue." had escaped me - and probably is the cause as there is a small
logo in the report.
I will remove it and try again.

Once again, sorry if I have caused offence.
 

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

Top