Email Attachment

T

tcb

I have found Arvin Meyer's code which allows sending an attachment
using Outlook which works perfectly if the user's email program is
Outlook. However, some users use other email programs. SendObject
will not work for me because the attachment is not an Access object.
Is there a VBA solution for this? Thanks.
 
T

Tony Toews [MVP]

tcb said:
I have found Arvin Meyer's code which allows sending an attachment
using Outlook which works perfectly if the user's email program is
Outlook. However, some users use other email programs. SendObject
will not work for me because the attachment is not an Access object.
Is there a VBA solution for this?

MAPI might work for you.
http://www.granite.ab.ca/Access/email/mapi.htm

If the other email programs are of a limited, known subset, that is
just a few of them, then you may very well find VB/VBA code that will
work quite well. See http://www.granite.ab.ca/Access/email.htm for
some possibly relevant links.

Also note that you will want to use late binding as otherwise your app
will puke and die with wield messages when executing on a computer
without Outlook installed.

Late binding means you can safely remove the reference and only have
an error when the app executes lines of code in question. Rather than
erroring out while starting up the app and not allowing the users in
the app at all. Or when hitting a mid, left or trim function call.

This also is very useful when you don't know version of the external
application will reside on the target system. Or if your organization
is in the middle of moving from one version to another.

For more information including additional text and some detailed links
see the "Late Binding in Microsoft Access" page at
http://www.granite.ab.ca/access/latebinding.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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