Macro: VBA code to move/forward email based on subjects and attachments

Discussion in 'Outlook' started by Shy, Apr 21, 2017.

  1. Shy

    Shy

    Joined:
    Apr 21, 2017
    Messages:
    1
    Likes Received:
    1
    Hi, if you can please help me with this code it would save me hours. My VBA code has failed to date. Thanks.

    I have multiple email addresses set up in Outlook 2016, the email address I want the macro to run on is secondemail@xyz.com This email address has 2 folders under the Inbox called 'Part1' and 'Other Parts'.

    When I run the macro, I want the macro to:
    1. Loop through every email in the Inbox of secondemail@xyz.com
    2. If the Email Subject contains "* Part1 * S0#######" and has an attachment, move the email to the Folder called 'Part1'. (example subject lines that fit this criteria include 'Part 1 lego S01234567', 'Lego Part 1 arm S03454325', etc)
    3. If the Email Subject contains "Part 2" or "Part3", forward the email to otherparts@abc.com and move the email to the Folder called 'Other Parts'.
    4. No action is taken on all other emails.
    5. The macro ends when all emails in that inbox have been checked.

    Thank you so much.
     
    Shy, Apr 21, 2017
    #1
    Vikram Shankar Mathur likes this.
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.