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


Apr 21, 2017
Reaction score
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 (e-mail address removed) 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 (e-mail address removed)
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 (e-mail address removed) 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.

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. After that, you can post your question and our members will help you out.

Ask a Question