Outlook Mail Message filter 3 subject keyword

Hi in the filter how can i filter 3 subject keyword in 1 ?

Like my subject contain
ITT2 File
[YCS] Shift Summary Report
[YCS] Performance Report

Hi @CoolRobot
you can filter by using the assign activity

read the outlook mail messages uisng Get Outlook mails and store in mail_list

now use the assign activity

mail_list= mail_list.AsEnumerable().Where(Function(mail) mail.Subject.ToString.Contains(“ITT2 File”) or mail.Subject.ToString.Contains(“[YCS] Shift Summary Report”) or mail.Subject.ToString.Contains(“[YCS] Performance Report”)).ToList()

Then the mail_list contains only the mails which contains the above subject lines

Nived N
Happy Automation


Hi i got some error as it say Subject is not a member of Char

edit Nvm is Fix

But now how i assign as mark as read only for this subject since i make them to a varialbe?

Needed some help still

hi @CoolRobot

i believe it was due to type conversion , instead of linq you can use for each

for each mail in Mail_LIst

change type argument to system.mail.mailmessage

item.subject.tostring.toupper.contains(“ITT2 FILE”) or item.subject.tostring.toupper.contains(“[YCS] SHIFT SUMMARY REPORT”) or item.subject.tostring.toupper.contains(“[YCS] PERFORMANCE REPORT”)

I had no issues with the code
below is the screenshot


Get Outlook Mail property

Assign activity

Same code is used for this

Nived N
Happy Automation

hi after i have assign mail_list how can i mark them as read using foreach?
what about the condition how i set it?

Still looking for help
just to read this 3 subject
email mark as read in my inbox and the rest not being mark as read

currenttly i found a temp fix that since i have sent from the same sender i can use that to read while subject to read it without read the rest of the same sender

1 Like

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