Add Attachments Programmatically

A

Alex Davidson

My company uses a service that allows the sending of faxes via email but I
would like to avoid people having to remember the password that is necessary
so I wrote a macro using the Redemption add-in that prompts for a fax number
and starts a new email as follows:
TO: user@faxservice
SUBJECT: password fax #

Ideally, I would like to be able to allow users to attach documents they
want to send using a Browse button so that they never have to see or touch
the email, thus reducing the risk of ex-employees with a grudge using our
service illegally.

Can anyone point me in the right direction or otherwise tell me it's not
doable?

Thanks,
Alex
 
K

Ken Slovak - [MVP - Outlook]

Once you have your MailItem or SafeMailItem reference you get the
Attachments collection. Then code to add an attachment would be
..Attachments.Add(<file path and name>). You can even display a form
with a common dialog control in it and use that control's methods to
open in a specified directory and with a specified file type
preselected. See the Object Browser help for Attachments.Add for some
sample code for that.
 
A

Alex Davidson

Thanks - I have it figured out.
If anyone wants me to share the code let me know.

Alex
 

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