COM error in downloading attachment from outlook through win32com
问题 import win32com.client import os outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") inbox = outlook.GetDefaultFolder(6) messages = inbox.Items message = messages.GetFirst() attachments = message.Attachments for i in messages: if(i.UnRead==True): attachment = attachments.Item(1) attachment.SaveASFile(os.getcwd() + '\\' + str(attachment)) else: pass I am getting below error when trying to download the attachment from outlook Error: com_error: (-2147352567, 'Exception