This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have various spreadsheets (all of the same format) in a folder in my Outlook, sent by various different people. Is Alteryx able to read my mailbox and extract the Excel attachments within the email and process them? If so, what's the quickest / easiest way to do this?
Below is the python code I created for my office. i The sub_today / att_today is where you can put the file name(s) you want to extract, or you could remove and pull everything in a folder. Let me know if you have any questions. You should be able to have the setup complete in a couple of hours.
from win32com.client import Dispatch
import datetime as date
outlook = Dispatch("Outlook.Application").GetNamespace("MAPI")
inbox = outlook.GetDefaultFolder("6")
all_inbox = inbox.Items
val_date = date.date.today()
sub_today = 'test’
att_today = 'test.xlsx'
for msg in all_inbox:
if msg.Subject == sub_today:
for att in msg.Attachments:
if att.FileName == att_today:
att.SaveAsFile(os.getcwd() + '\\new.xlsx')