Move Outlook folder based on attachment

Hi All,

I have a script that access a mailbox, retrieves mails and reads the attachments. Based on the cell value in the attached files the mail needs to be moved to a different internal mail folder.

Example :

Sheet1 - A1 has 0 then the mail needs to be moved to folder A
A1 has 1 then the mail needs to be moved to B

The above logic works until there are 2 attachments with ( 1 & 0 )

then the script moves the folder to B

I am exploring to see if there is a way to route it to A in case there is even 1 file with cell value 0


How are you reading the files?

Download to a location and read each file(read cell activity) using for each?

If any of the value is 0, break the loop (break activity) and move the folder to A.

Hi @vvaidya

I am using an excel scope to red the file, downloading to a local folder and executing.

If I break the loop will it not process the files, I want it to process the files.

Create a boolean variable and assign True to it once 0 is found.Once you process your files, based upon that Boolean variable, execute your outlook logic.

Attaching my (17.5 KB)