1

I want to filter out emails on outlook based on a subject line that start with/ end with/ contain specific words/characters. Then I want to save those emails in a folder.

To begin with, I tried to follow the code for filtering out emails based on senders. But I am stuck:

outlook = win32com.client.Dispatch("Outlook.Application").GetNameSpace("MAPI")
inbox = outlook.Folders("abc@xyz.com").Folders("Sent Items")

Filter = "[Subject] = 'Unaff'"

items = inbox.Items.Restrict(Filter)
Deepan Das
  • 13
  • 5

1 Answers1

0

Have you tried somwthing like this?

Add this line to your code

    messages = Messages.Restrict("[Subject] = 'Automatic Reports'") #Title  contains  this  

you can use the information given in this post too Iterate through folders in a secondary Outlook Inbox using Python

Ljg
  • 141
  • 8