Aditi Patil
Aditi Patil

Reputation: 67

Filter Outlook Mails by Partial String or Partial Text in Subject

Hi Tried to search the solution by which I can filter the outlook mail by the part of string exist into that rather than filtering the mail on complete subject.I am using win32com

import win32com.client
if mail.subject.contains('Filter Text'):
 message.Unread=False

Upvotes: 0

Views: 2340

Answers (1)

Hietsh Kumar
Hietsh Kumar

Reputation: 1329

you can try below

if 'Your String' in str(message.subject):

Upvotes: 1

Related Questions