Support Portal

for ProcessRobot and WinAutomation

Start a new topic

Save email attachments one-by-one

Is there any way to save not all attachments from email folder at a time but one-by-one using loop (for example, if I need to rename them on the go). I know that it is possible for email processing (mark, answer, resend etc.), but what about attachments?


Hello Roman,

You could save the attachments in a temp folder and just rename/remove the ones you need. At the end of the process, you could proceed and delete the temp folder.

Note that attachments for a specific email will be stored in a list, so you could iterate the retrieved emails variable with a For Each loop and refer to a specific email's attachment with the following syntax: 

%CurrentEmail.Attachments[0]% <-- first attachment for that specific email


Is that the only way? What if there's hundreds or thousands emails in folder? Process will last forever each execution. No way to read emails list => loop it with filter => save only needed attachments?


You could narrow down the retrieved emails by applying filters, but still you would need to save the attachments for all of the retrieved emails.

I suppose you could retrieve the emails first, without saving the attachments, extract the information for the current email - subject, from, to, body - and then within the same loop, use the "Retrieve Emails" action and save the attachment by applying the criteria that would only match the current email.

Login or Signup to post a comment