我正在尝试从多个具有相同主题和发件人的邮件中下载多个附件,但我不知道自己在做错什么,有人可以帮助我吗?
import win32com.client
Outlook = win32com.client.Dispatch("Outlook.Application").GetNamespace("MAPI") #Opens Microsoft Outlook
folder = Outlook.Folders[3] #N4 Invocie folder
subFolder = folder.Folders[5] #N4 Invoice subfolder
subFolderMessages = subFolder.Items #Invoice items object
message = subFolderMessages.GetFirst()
while True:
subFolderItemAttachments = message.Attachments
nbrOfAttachmentInMessage = subFolderItemAttachments.Count
x = 1
while x <= nbrOfAttachmentInMessage: attachment = subFolderItemAttachments.item(x)