View this in Firefox, Chrome, Safari or Opera. Not IE. Click the play button. The action starts at ~20 seconds.
import win32com.client def get_mails(folder, path=[]): for mail in folder.Items: yield mail, path for subfolder in folder.Folders: for mail, subpath in get_mails(subfolder, path + [subfolder]): yield mail, subpath outlook = win32com.client.Dispatch('Outlook.Application') mapi = outlook.GetNamespace('MAPI') for store in mapi.Stores: if not store.IsDataFileStore: continue for mail, path_list in get_mails(store.GetRootFolder()): path_str = '/'.join([p.Name for p in path_list]) print mail.size, path_str, mail.subject.encode('utf8')