Link to home
Start Free TrialLog in
Avatar of Andy Brown
Andy BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Creating an email with attachments through VBA

I need my users to be able to create and email that may contain several attachments, will use their own autosignature at the bottom (without being reformatted) and if possible be able to add a default line of additional text into the emails body.

All of the users have Access 2003 and Outlook 2003 upwards.

Thank you.
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

The AutoSig in a function of Outlook ... AFAIK, the only way to include that through a 3rd party item (like Access) is to actually include it when you build the email. See this link for how to do this:

http://social.msdn.microsoft.com/forums/en-US/isvvba/thread/9cfedfdf-b7a8-442d-96b8-a5cf5a149673

You can automate Outlook and build an email with as many attachments as you need:

http://support.microsoft.com/kb/161088

Note this uses Early Binding, which requires you to have a reference to the Outlook Library. If you'd prefer to use Late Binding, which does NOT require a reference and instead uses whatever version is installed on the machine:

http://support.microsoft.com/kb/201096
Avatar of Andy Brown

ASKER

Close, but I was hoping to find a solution that wouldn't care if it was XP/Vista or RTF/HTML.
I'm not sure what you mean ... the code I suggested would work on any machine, regardless of the OS, so long as Outlook was installed.

As to HTML vs RTF - I'm not sure what you're referring to. The code I suggest is an example, and you would of course have to customize it to your needs.
Fair enough - and yes I am slowly getting it to work.  The problem that I've got is that it will be run from different environments.  Some with vista, some with XP, some using RTF and some using HTML emails - so i was really just trying to get a catch all solution.
ASKER CERTIFIED SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Spot on.  Thanks again.