I created a code that should read through 4 different email inboxes and move all emails containing a specific keyword and after that save all attachments to the folder relating to the keyword.
To do so I iterate first through the rows of a datatable and store the keyword, the inbox address, the folder path in variables. Then I use these variables to read through the emails and to identify the subject.
From everything I find here, my code makes perfect sense. However, if I run the code it saves only a few emails and in random folders (can’t see the logic behind).
I would be very happy if somebody could look at my code and tell me where it might be weak.
Thank you very much!
EmailContains.xaml (33.0 KB)