Log in

View Full Version : Save ALL attachments



deppeler
11-21-2007, 08:28 AM
Hi,

I am new to this forum and VBA in general.
What I am looking for I am sure is already here.
I have incoming email with attachments (all file types) and I want to be able to automatically save them (and delete?) to a specific folder/s on the HD.
I have rules in place to save the email/s to a specific folder/s in Outlook based on subject.
I have these folders in Outlook ... Inbox\Backup\Cheri & Inbox\Backup\Tony
And on the HD ... Email Backup\Cheri & Emai Backup\Tony
I have found code which refers to a single attachemt type but no ALL attachments.
Could someone point me in the right direction, and how to install thanks.

Paul

JKwan
11-21-2007, 11:06 AM
Take a look at this.
http://vbaexpress.com/kb/getarticle.php?kb_id=953

deppeler
11-21-2007, 12:37 PM
Thanks, I looked at that but I can't get it working.
When I Compile (Debug Menu...) I get this message:
Compile Error: "Variable Not Defined"
and it highlights this:
'Check for html mail or not:
If myItem.BodyFormat = olFormatHTML Then
I run it anyway and it doesn't work.
The only things I changed were:
From
Const strRootFolder_c AsString = "C:\Data\Appendices\"
to
Const strRootFolder_c As String = "C:\Email In Backups\"

thanks

TonyJollans
11-24-2007, 09:50 AM
That shouldn't cause a problem but you could try using the literal 2 instead of it - what version of Outlook are you using?