Find out Attachment-Name

Hi Guys,
I just used the Save Attachment-Function and “CType(email.Attachments.FirstOrDefault, Attachment).Name” to get the Attachment-Name. But the name is with the data format like title.zip or .xlsx.
My question is how to get the Name without the data typ in it.

Thanks

@LeTH23

You mean want the file name without file extension ?

If above mentioned expression giving both filename and extension then try below expression to get only filename.

CType(email.Attachments.FirstOrDefault, Attachment).Name.Split("."c)(0).Trim

1 Like

grafik

Thanks alot.

1 Like

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