How to download all attachments from outlook using python?
stackoverflow.com › questions › 50473865Myfolder = mydesktop + 'Outlook Export/' if not os.path.exists(Myfolder): os.makedirs(Myfolder) try: for message in list(messages): try: s = message.sender s = str(s) print('Sender:' , message.sender) for att in message.Attachments: # Give each attachment a path and filename outfile_name1 = Myfolder + att.FileName # save file att.SaveASFile(outfile_name1) print('Saved file:', outfile_name1) except Exception as e: print("type error: " + str(e)) x=1 except Exception as e: print("type error ...