Trying to list all Outllook stores (and finally all e-mails in those stores):
import win32com.clientoutlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
stores = outlook.Stores
print(stores.Count)
for store in outlook.Session.Stores:print(store.GetRootFolder())
While it was still working yesterday I see the following output today:
Traceback (most recent call last):
10File "C:/Users/DJ/PycharmProjects/Mailmagic/outlook_test.py", line 6, in <module>for store in outlook.Session.Stores:
TypeError: 'Stores' object is not iterableProcess finished with exit code 1
In between I was running makepy.py. Version: Microsoft Outlook 16.0 Object Library