Extract File Name For Outlook Attachment

Hi Everyone,

I am trying to iterate through extracting the attachment file names from outlook emails and appending them to an excel file. I am having issues trying to get the file name of the attachments. Any help would be appreciated!

P.S. each email will have exactly one attachment.

@cmartin685

Welcome to the community

Once you get the emails using get mails activty…you would have list of mails

To access each mail use for loop

Then insid ethat gor each email to know attachments use mail.attachments…this will give list of attachments

Now you can loop theough each attachment again using loop

Attachment.name will give the name of attachment

If you know yhe attachment is one and every emaill has it then instead if second loop mail.attachments(0).name will give the name

Cheers

This worked! thank you @Anil_G .

@cmartin685

Glad it helped…

Can you close the topic by markin solution if resolved.

Happy automation

Cheers