Attachment throwing error

Hi
Am trying to get email attachment name with formula attachment= Ctype(mailmessage.attachments.FirstorDefault, attachment).Name
But it’s throwing error like attachment is ambiguous imported from namespaces or types Microsoft.exchange.webservices.data, System.net.mail.
Please help to sort this out

Hi @dpaktr

Try like this

 New System.Net.Mail.Attachment(Ctype(mailmessage.attachments.FirstorDefault, attachment).Name)

Checkout this thread

Regards
Sudharsan

1 Like

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