I\'m trying to understand outlook interaction through win32com better. I\'ve been unable to find clear documentation that allows me to utilise win32com to read emails effec
For everyone wondering how to reach any default folder not just "Inbox" here's the list:
3 Deleted Items
4 Outbox
5 Sent Items
6 Inbox
9 Calendar
10 Contacts
11 Journal
12 Notes
13 Tasks
14 Drafts
There are more (Reminders, Sync errors etc.); you can get whole list with this code (inspired by John Cook's solution to Folders):
import win32com
outlook=win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
for i in range(50):
try:
box = outlook.GetDefaultFolder(i)
name = box.Name
print(i, name)
except:
pass
I'm not pasting the whole list here, because mine is in Polish and wouldn't be really helpful.