Rules and attachements

Posted on 2006-04-13
Last Modified: 2010-04-08
Can I create a rule in Outlook 2003 where I can save an attachement to a network drive?  The sender and the attachment will always be the same.
Question by:etec
    LVL 76

    Expert Comment

    by:David Lee
    Hi etec,

    With a script, yes.  Without one, no.  The script is pretty simple.  If that's an option for you, then let me know and I'll post the code and instructions for using it.

    LVL 1

    Author Comment

    Yes yes please please
    LVL 76

    Accepted Solution


    Here it is.  Follow these instructions to use it.

    1.  Start Outlook
    2.  Click Tools->Macro->Visual Basic Editor
    3.  If not already expanded, expand Microsoft Office Outlook Objects and click on Module1
    4.  Copy the code below and paste it into the right-hand pane of the VB Editor window
    5.  Edit the code per the comments I included in it
    6.  Click the diskette icon on the toolbar to save the changes
    7.  Close the VB Editor
    8.  Click Tools->Macro->Security
    9.  Set the Security Level to Medium
    10. Create your rule and set the action to "run a script".  Pick this module as the target script.

    That should do it.

    Sub SaveAttachmentToFolder(Item As Outlook.MailItem)
        Dim olkAttachment As Outlook.Attachment, _
            intCounter As Integer
        For intCounter = Item.Attachments.Count To 1 Step -1
            Set olkAttachment = Item.Attachments.Item(intCounter)
            'Change the folder name and path as desired
            olkAttachment.SaveAsFile "C:\Attachments\" & olkAttachment.FileName
        Set olkAttachment = Nothing
    End Sub
    LVL 1

    Author Comment

    Works great!!!
    How do I give you points?
    I'd give you more if I could
    Thanks so much!!
    LVL 76

    Expert Comment

    by:David Lee
    Glad to hear it.  You're welcome.  

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
    Set OWA language and time zone in Exchange for individuals, all users or per database.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now