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)