Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df = pd.read_excel(r'path')
- df = pd.DataFrame(df)
- df = df[['Short Name','File Name']]
- print(df)
- outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI")
- inbox = outlook.GetDefaultFolder(6)
- subfolder = inbox.Folders(2)
- messages = subfolder.Items
- for message in messages:
- attachments = message.attachments
- for attachment in attachments:
- attachment.SaveAsFile(r'path' + '\'+'test' + str(attachment))
- print(format(attachment))
- So far I have this code that downloads the files to a designated folder and prints the first word of the subject. Please link any documentation/ learning material as everything is very new for me.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement