I'm struggling with python integration with outlook using win32com.client.
All I am trying to do is get the most recent email from outlook and (at the moment) retrieve and print the name of the attachment
The code I'm trying to use:
import win32com.client
outlook = win32com.client.Dispatch("Outlook.Application").GetNamespcae("MAPI")
inbox = outlook.GetDefaultFolder(6)
message = inbox.GetLast()
att = message.Attachmets
print (att.filename)
Output
com_error: (-2147221005, 'Invalid class string', None, None)
Any help would really be appreciated.