Selecting an excel attachment from outlook

Hi,

I tried to use the filter in save attachment using StudioX to select only the excel files from an outlook email but didn’t work.

Any ideas on how to specifically save the excel files throughout the process?

Hi @Moe_D, welcome to the Community.

In the Save Email Attachments activity, set the filter by file name as *.xls*

Hope this helps,
Best Regards.

1 Like

Hi @Moe_D

  1. “Save Attachments” activity will save all attachments to a folder.
  2. Then use “Directory.GetFiles” activity to retrieve a list of all files in the folder.
  3. Then drag an drop “For Each” loop to iterate through each file in the folder.
  4. In “If” statement filter out non-Excel files. You can use the “Path.GetExtension” method to get the extension of the file and check if it’s “.xlsx” or “.xls”.
  5. Within the “If” statement, use the “Copy File” activity to copy the Excel file to a new location.

Hope this will resolve your issue.

1 Like

Thank you … i will try to follow these steps and hope it works

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.