Outlook File Attachment Based on Contact Name

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I'm an Access developer and have limited experience with Outlook development, so hoping someone can help here.

I'll Try to explain this as best as I can. When the client selects a a contact to send a message to, I need all information pertaining to that client to be displayed in the e-mail or as a file attachment. The information will come from an outside file that will be generated from a database.

I thought of a few possible ways of doing this but I'm really not to familiar with Outlook, so if anyone has better suggestions, I'd love to hear them.

First I thought if I generated a separate file for each contact and then within Outlook VBA, code could be written to get the current contact that the e-mail is being sent to and attach the file that has the same name.

My other thought was if I was to create a form and have those form fields tied to a data source such as Excel or a text file and some type of SQL statement could be written where it would look for the matching contact in the file and populate the fields with the corresponding data. I don't even know if this would be possible.

If anyone can offer me some suggestions on this, I would really appreciate it. I'm sort've out of my comfort zone with this but I look at it as new learning experience, which is always good. Thanks. .
Submitted using http://www.outlookforums.com
 
If this is a solution that you plan to deploy then using Outlook VBA is not
suitable. Outlook VBA is intended mostly for prototyping or personal code,
not deployment.

The first question I'd ask are where will this code run? Will it be in
Outlook, in Access, as standalone code, etc.? I'd also ask what Outlook
versions you intend to support, what will trigger the code to start working
and what languages you are familiar with.

You mention a client selecting a contact to send a message to. Is this in
Outlook? Is the message always open already or do you have to create it?
What about other ways of sending to a contact such as selecting one and
clicking something like a New Message to Contact button?

If the code is running in Outlook then I'd advise using a COM addin.
However, the project requirements and operation really need to be much more
clearly defined before specific architectural advise can be provided.

For general Outlook programming information that might give you some ideas
you can look at www.outlookcode.com
 
Thanks for the reply. This would all need to be performed through Outlook. The files would be generated by the database but that's pretty much the only area that Access would play a part. I would need it be setup, so when they hit send it would trigger everything or even if I could create a button that would work just as well.

This would be done in Outlook 2007. The user also has business contact manager, so I don't know if that makes anything easier.

Basic sequence of events would be this.

1. User creates an e-mail.
2. A contact is selected.
3. E-Mail is sent with corresponding file attachment or information in the message.

If the event could even be triggered when the contact would be selected that would work just as well.

I am familiar with VBA but as I'm sure you know VBA differs between the Office applications. Same basic syntax but you have objects and such that are specific to each app. Any suggestions?

kenslovak wrote on Thu, 03 December 2009 09:3
 
Back
Top