Last saved file

I an downloading attachments from outlook to a specific folder and I need to edit them then re send an email with the attachment
How cab I send the latest excel sheet saved in the folder as an email (latest by date)


Hi @khaled_emad,
You can use For Each File in Folder Activity as below:

and if you want to wait till file be downloaded first you can use (Wait for Download) Activity it will wait till file added to download folder location
Please check and update us if you still have issue :slight_smile:

thank you man but is there another way than using for each file in folder ?

You can use the second option in my comment ( Wait for Download ) activity try it and update us if you still have issue.

are you saving multiple attachments from outlook to a folder then you process it but you want to send further by mail just the one most recently saved (latest)?
You could make int32 variable as counter which would increase with each downloaded attachment, add the counter to attachment name during saving then when sending out mail you can attach only the attachment that includes your counter in name.

Would that work for you?


Actually I am downloading excel sheet from email to a folder edit it and resend it
Once I download another sheet from another email to the same folder location, the folder now will have 2 sheets I need to email the last 1 downloaded

@khaled_emad please check below solution and update us if you still face issue.

in a loop save your attachment and create a variable:

refer to the variable when processing excel:


finally refer to the same variable when sending it out


each loop will work only with currently downloaded file, even though there’s more than one in a fodler.