Outlook macro needed

  • Thread starter Thread starter Andre Croteau
  • Start date Start date
A

Andre Croteau

Hello,

I receive a considerable amount of emails each with one Excel file
atttachment, and the name of the attachment has a distinct name.

I would like to move these messages to a distinct directory in OUTLOOK (done
manually), and then apply a macro to those messages which would
automatically save the attachments from each message to a specific directory
for later use. I don't want to open the files from the email, just save the
attachment. Can this be done? I have seen how macros can help in Excel,
but donèt know if it can also be done in Outlook.

Thank you in advance.

André
 
Hello Ken

Thanks for the link.

I copied the code into the Outlook macro section, isolated a particular
directory in my outlook mail.
However, I tried to run the macro, and it stoped at the following line:

Private Function GetTempDir() As String

Am I doing anything wrong?

Thanks in advance.

André
 
Any errors? Did you set a project reference to Windows scripting
("Scrrun.dll")?
 
Hello Ken,

Sorry, you have lost me.
What is and how do you set a project reference to Windows scripting
("Scrrun.dll")?

André
 
In your VBA code project select Tools, References to add a reference. Scroll
down to Microsoft Scripting Runtime (Scrrun.dll) and check it. That adds a
reference to scripting.
 
See http://www.slovaktech.com/code_samples.htm#StripAttachments for code
that will strip attachments from selected emails.

This is a great collection, especially to a fledgling outlook macro
writer.

Thread Hijack Question. I tried the Disclaimer macro in OL2003 in a
reply. Works fine, but it appears to strip HTML messages and rewrite
them in regular text. For example an email link was expanded to
"HYPERLINK 'mailto:....'". My guess that this is a function of the way
outlook handles the

"objMail.Body & strDisclaimer"

instruction. Does it essentially, copy the entire body, add the
language and then spit the result back out unformatted? If so is their
either (1) any way to overcome this so that the original formatting is
kept intact or (2) another way to add text to a message by macro?




Mark Kolber
Denver, Colorado
=======================
email? Remove ".no.spam"
 
HTML content is not in .Body, it's in the .HTMLBody property. You would have
to read in the original HTML content and append the disclaimer you want
using proper HTML encoding. If HTMLBody is a null string ("") then there's
no HTML content in the message.
 
Back
Top