How to get Outlook multiple attachment file name without saving the file

Hello,

I am trying to get the multiple attachment files name which has .xlsx or .xls extention without saving the files into folder. Can anyone please suggest how to achive this?

I am trying with below method which gives me output but with entire path instead of name.

Hi,

Could you try with the below expression it will retrieve the attachment name.

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

1 Like

In your code only change the argument type to System.Net.Mail.Attachment and then inside for each you can provide “item.Name” for there you will get all the names one by one

Hello,

thnx for reply. I have tried this one but not getting desire output.

requirement - Only Excel file attachment(multiple in some cases) names without saving it.