If you want to run the code by a rule, use a Run-a-Script-Rule, for which
the declaration looks like this:
Public Sub WhatEver(Mail as Outlook.MailItem)
' your code
End Sub
In that procedure you can check the Mail.Attachments collection for whether
there's at least one attachment. Also, see the Attachment.SaveAsFile
function.
--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
<http://www.vboffice.net/product.html?lang=en>
Am Thu, 29 Apr 2010 03:17:53 +0100 schrieb Mr. Walnuts:
> I should start by saying that I have never used VBA for Outlook. I can
> use basic Outlook Functions; mail rules, data files, etc.
>
> I -do- however have experience using Macros & VBA for Excel
> 2003/2007/2010.
>
> I'm making an excel application to automate as much of a friend of
> mine's administrative tasks as possible for his work. Does anyone know
> whether or not you can make a macro on Outlook or Excel to retrieve
> email attachments from Outlook, file the attachments in a specified
> location on his computer based on Outlook rules, and add the
> attachment name to a database on Excel so that the attachments can be
> referenced and opened from an excel worksheet that lists the
> attachments?
>
> I realize this is an Outlook forum, so really if someone could give me
> insight on how to get the Outlook part of it (Autosaving Email
> Attachments based on specified criteria to a folder on the computer); I
> can setup the Excel side myself.
>
> Also, does anyone know of any decent online tutorials about Using
> Outlook and Excel together to automate tasks?
|