How to send and attached an excel file by reading its file name

Hello Everyone,

I would like to ask how can I send and attached an excel file by reading its file name?

For example:

I have a list of excel files that contains names of different people

But I would need to read the file name and match its name to its email in this excel file -
Email Details.xlsx (9.5 KB)

I have tried using a for each loop to get the emails but not to sure how can i read the file name and match its name to its email in the email column.

attachmentName = CType(item.Attachments.FirstOrDefault, Attachment).Name

Check this

Hi!

Try like this

Take two assign activities

FolderPath(String) = "Desktop\" 
Files(Arr(String)) = Directory.GetFiles(FolderPath,"*.xlsx")

->Take one For each Activity
->Provide the Files Variable
->Take one more Assign activity

Mention the expression like this

FileName (String) = Path.GetFileNameWithoutExtention(item).ToString

Try this and let me know

Regards,
NaNi

1 Like

@Hey_hi ArrayOfFiles = Directory.GetFiles(“ExcelFileFolderPath”)

For loop (ArrayOfFiles)>>
Take If activity
EmailID.Contains(Item)
Then Send Email

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