Does not identify .txt attachments

I need to download Outlook attachments to a folder and check if only .xlsx attachments are present. If there are attachments in any other extension, it should throw an exception.

Apparently it does not seem to identify .txt attachment and download it.

How can we achieve this ?

Thanks.

1 Like

You are getting any error??

Apparently it does not read the ‘For Each item’ condition when I try to read the extension from the directory. This is what I am doing.

vFolder = the folder path
vDirectory = Directory.GetFiles(vFolder," ",SearchOption.AllDirectories)

For each item in vDirectory
if Path.GetExtension(item) = “.xlsx”

Then,
Save attachment

Else
Throw Exception

I just figured out that if the size of the attachement is 0 bytes, it does not detect the attachment. I typed “abc” into the .txt file, saved it and mailed it. The bot could then download the .txt. file.

Please let me know what could be the issue here.

Thanks.

Can you attach your workflow…