Macro for moving mails to folders according to specific criteria

Joined
Jul 2, 2014
Messages
1
Reaction score
0
[FONT=&quot]Hello,
Me and my colleagues are facing quite an unusual problem. We daily receive several messages with specific format. We need to sort this messages according to the body text, to be precise according to text in the 2nd and 4th line.

Here is an example:[/FONT]
[FONT=&quot]SCR[/FONT]
[FONT=&quot]S14[/FONT]
[FONT=&quot]02JUL[/FONT]
[FONT=&quot]PRG[/FONT]
[FONT=&quot]K QS100P 02JUL02JUL 0030000 00073H 0740BTS P[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot]This is a message from our partner and we need to move it automatically from INBOX folder (or any other folder) to the folder S14 (line 2) and subfolder PRG (line 4)[/FONT]
[FONT=&quot]

Currently we have a file tree and we sort these messages manually, which is obviously a pain.

I found several tips how to create a macro which moves messages to personal folders but I can't implement the If condition (if there is specific text on line 2 move it to specific folder).

Could you please help me to create such macro?

Thanks a lot in advance![/FONT]
 
Well then, you have to search for 2 VBA codes.
1. To Read Email text.
2. To move to a PST.

I believe you code to do the second one. Check this article on reading a email subject or body. It might be of some help to you.
Article with VBA To read Email Details.

Now integrate both code and put a If condition after you get the Email text.
Hope this helps.
 
Back
Top