Creating an email with attachments through VBA

Posted on 2009-02-23
Medium Priority
Last Modified: 2012-08-13
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.
Question by:Andy Brown
  • 3
  • 3
LVL 85
ID: 23710548
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:


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


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:


Author Comment

by:Andy Brown
ID: 23710875
Close, but I was hoping to find a solution that wouldn't care if it was XP/Vista or RTF/HTML.
LVL 85
ID: 23710937
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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

by:Andy Brown
ID: 23711078
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.
LVL 85

Accepted Solution

Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 23711356
Certainly ... but the code supplied should work with any Operating System, assuming the user has sufficient permissions to read the directories where the sig files live (and they should, since those sig files belong to that user).

As to RTF-HTML - RTF is an incredibly complex monster, but if all you're doing is adding the Sig file, that would be formatted in RTF already, so you should be fine with it. HTML is a lot easier to work with and handle.

Author Closing Comment

by:Andy Brown
ID: 31550050
Spot on.  Thanks again.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question