Ok, for the sent item I could make it run automatically, I am starting to get the logic. Thanks for that!

But for the emails received, I actually receive the following error when I restart outlook:

"Compile error:
Invalid attribute in Sub or Function"

Also, the following part of the script is highlighted
"...WithEvents Items As Outlook.Items"

Any idea?