Opening Outlook Attachments in VBA

  • Thread starter Thread starter JSkeggs
  • Start date Start date
J

JSkeggs

Hi,

I really don't know where to start on this, as I only have Excel/Access
VBA knowledge, and would therefore really appreciate any help!

I would like to write some code that for an e-mail that I have selected
(highlighted) in MS Outlook to open the attachement (will be either .pdf
or .fax files (Adobe Acrobat or Faxmaker Fax Viewer)) and print it out,
then close the attachement. If it is possible to mark the fax as viewed
as well, then this would be beneficial.

I am aware that this has some security issues, but we have some fairly
comprehensive Anti-virus software here, and this would be really
beneficial.

Ultimately I would like to attach this to a button, and roll it out to
other users.

Kind regards in advance

James
 
To do that you'd have to access the attachment and then save it to the file
system and then open it and print it. You can't directly open an attachment
without doing that.

For getting the attachment and saving it to the file system see
http://www.slovaktech.com/code_samples.htm#StripAttachments. You need to
reference Windows Scripting in your project (Scrrun.dll). That library can
also be used to open the file once it is saved.
 
Many thanks for your reply,

Does anyone know why I can't change the Macro Security setting to
anything other than "High"? I try to select "Medium" or "Low", but
Outlook seems to automatically default to "High". I can't get off this.

It is becoming really irritating as I can't run any code in MS Outlook.

Any ideas or work arounds would be greatly appreciated.

James
 
Back
Top