Outlook VBA to move emails to folders (like rules)

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,169
Office Version
  1. 2013
Platform
  1. Windows
Hi all firstly thanks for any replies :) as always grately appreciated.

Scenario:
I maintain a group outlook exchange email account. For data protection every email sent out TO a client, a copy is sent to a single sub folder named 'flowlinks'.
There is a lot of traffic back and to often we need to search back through the flowlinks folder to find original correspondance but due to the sheer amount of emails it can be time consuming.

My idea:
Create a sub folder for each client and set up a rule to say "when the email hits 'flowlinks' see who the email was sent to and move it to the folder with the same client name.

Problem:
I have 33 clients Outlook says after 4 I have no more room to create any more rules!
This leads me to hopefully a VBA solution:

What I want my VBA to achieve:

When an email arrives in the flowlinks sub folder from person A,B,C,D,E,F,G,H,I,J,K,L only (Theres only 12 people)
Look at the email address in the 'TO' field
If it contains @client1 move it to client 1 sub folder
if it contains @client2 move it to the client 2 sub folder....an so on.

Im no VBA expert but even if someone could give me a rough syntax im pretty sure I could figure it out.....any alternative solutions also very welcome!

Thank you! :)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
At the risk of self-aggrandizement, the code found here should be a good starting point: http://www.jpsoftwaretech.com/outlook-vba/stock-event-code/

You would need to modify (1) to point to your 'flowlinks' folder, and (3) would need to contain your business rules for
  1. figuring out who the email came from;
  2. figuring out who the email is to;
  3. determing the destination folder (and making sure it exists), and
  4. moving the message to that folder.
 
Upvote 0
Thanks very much for your reply, gives me something to work with; appreciated!

:)
 
Upvote 0

Forum statistics

Threads
1,225,609
Messages
6,185,985
Members
453,333
Latest member
BioCoder84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top