Re: Automatically save attachment from specific sender

Tech-Archive recommends: Speed Up your PC by fixing your registry



Ken

I appreciate the help - I will be looking to implement this as soon as
I can. Thank you very much!

Richard


On 5 Feb, 15:59, "Ken Slovak - [MVP - Outlook]" <kenslo...@xxxxxxxx>
wrote:
I'd go with a macro called by a rule myself. That way you can set the rule
to fire when emails come in from specific senders that have one or more
attachments.

For a macro called by a rule the format is pretty simple. You set the rule
to run a script, which is your macro. The macro has a format of being Public
and having only 1 input argument, the MailItem that triggered the rule. So
the macro would look something like this:

Public Sub myRuleMacro(Item As Outlook.MailItem)
    ' code here
End Sub

For saving the attachment you can modify the attachment saving code athttp://www.slovaktech.com/code_samples.htm#StripAttachments, which saves all
attachments in the currently selected items in a folder. You can remove the
loop and use the Item passed to you as the handle for the item to remove
attachments from.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm

"RichardSchollar" <RichardSchol...@xxxxxxxxxxxxxx> wrote in message

news:d32c4b57-3f81-4dc2-9740-f306d5ea169e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



Hi

I want to automatically save down an attachment from a specified
sender to a specified directory on my computer.  I rarely have ever
used Outlook VBA, so I am after some guidance and possibly sample
code.

Having looked at the ThisOutlookSession module in the VBE am I correct
in thinking that I could use the event

Application_NewMailEx(ByVal EntryIDCollection As String)

to check for new mail from a specified contact and if an attachment is
present to save the attachment down to folder X?  I would subsequently
like to display a message alert on the desktop.

Will this work in the background? ie I spend most of my time in Excel,
so I would like Outlook to silently monitor incoming email and process
it automatically, just alerting me when the file is saved down to the
directory.

I did consider using Rules, but couldn't see any way to get a macro to
fire from the rule (so this may be down to my ineptitude rather than
it not being possible).

Any help forthcoming is appreciated.

Richard- Hide quoted text -

- Show quoted text -

.



Relevant Pages

  • Re: Automatically save attachment from specific sender
    ... That way you can set the rule to fire when emails come in from specific senders that have one or more attachments. ... For a macro called by a rule the format is pretty simple. ...
    (microsoft.public.outlook.program_vba)
  • Re: Run macro for each record in a query
    ... This will make the report run for the current user. ... which contains details of 'client ... I have a macro called 'send_emails' which uses the ... which I use to send the emails (a button on a form ...
    (microsoft.public.access.modulesdaovba)
  • Re: macro to assign category to new email
    ... hard-coded category to a number of selected emails in my inbox. ... Set objFolder = objInbox.Folders ... | macro button could just move the selected emails into a specific ...
    (microsoft.public.outlook)
  • Re: Suggestions for my paladin (V)
    ... the easiest way is to make a macro. ... This means that whenever you press 'f1' you will fire that ammo. ... Add in all your applicable bonuses to damage ...
    (rec.games.roguelike.angband)
  • Creating a macro to calculate number of mails per day
    ... I'm trying to acquire a VBA script for use in a macro that would be able to ... whereby 5/6 people all have access to this account. ... Wscript.echo strKey, objDictionary.Item ... people can activate it to get a reading of emails recieved for the day. ...
    (microsoft.public.office.developer.outlook.vba)