Get Outlook message Filter email

I am using get Outlook Mail Message, I need to filter the email which is contain an excel sheet only… any idea how to do the same.

Thanks in advance


You can use For each activity,

For each mail(must be type of in MailMessage{
if mail.subject.contains(“abc”){
// do something
// do something else

this way you can filter out emails

I need to filter if the email has an attachments with excel format


hope this will help to resolve the issue

Try using below expression in filter property

“[attachment]=’.xls’ OR [attachment]=’.xlsx’”

Refer here for more help : Chapter 11: Searching Outlook Data | Microsoft Learn

1 Like

Thanks For your replay,
it’s given me as below

Try removing the spaces

“[attachment]=’.xls’ OR [attachment]=’.xlsx’”

Well done, thanks

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