Full Version: VBA for Sending an Outlook Message
UtterAccess Discussion Forums > Microsoft® Access > Access Automation
hockeydood
I would first like to advise that my organization has 3 different versions of Office in play at the moment. All of our users run Access 2003 but the rest of the Office suite are 2007 (i.e. Outlook). To further confuse things, a handful of folks are testing Office 2010 at this point but they remain using Access 2003 as our BI does not support 2007 or 2010. That said, I have been searching all over and reviewing articles about the use of VBA to send an Outlook message from Access. It appears that everything was good until Office 2007 came along and things really started to get hosed up.

I am hoping that someone is currently using VBA in a mixed environment today and can lend a hand or finger in the right direction. I have a form that currently evaluates user names and fires a message based upon the name and specified event. I would like to add one more piece to that by firing off an e-mail to the supervisor of that associate when this event happens.

Anyone able to help me out here by chance?

crazy.gif iconfused.gif
Jeff B.
Rather than automate Outlook from Access, you could use the SendObject command in Access. As far as I know, it's non-denominational...
theDBguy
Hi,

welcome2UA.gif

I agree with Jeff. If all you would like to do is send simple email messages, you can use the SendObject method. But to answer your question about mixed environments, you would have to use "late" binding in your automation code to overcome that issue.

Just my 2 cents...
HiTechCoach
welcome2UA.gif

Welcome to UtterAccess.

I support mixed Office environments a lot. I generally now the version of Access, but not he version of Outlook.

I agree with theDBguy that Late binding is the way to go. I use late binding whenever possible. For more information see the links in my previous post on the subject
jleach
Personally, I've found that SendObject is difficult to get a nicely formatted report sent via email. The snapshot files I tent to avoid because not everyone has the snapshot viewer, and I prefer to send reports in a pdf format (utilizing Lebans' ReportToPDF utility)... but there's know that (that I'm aware of, anyway) to send an external attachment (let alone a few of them) using SendObject.

For that reason, I find myself using outlook automation (agreed, late-bound is definately the way to go).

In this thread I posted a copy of the procedure I use to send a late-bound outlook email with any number of external attachments, if it's of any interest to you.

hth


(is there a way to send a pdf report/external attachment using SendObject in 2003?)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.