1)在“Inbox”里面创建一个文件夹,命名为 “For Download” ,把需要导出附件的Email邮件放在For Download里面。
2)在D盘创建一个文件夹,命名为“Email Attachment Temp” 。
3)打开outlook,按下Alt+F11 粘贴如下代码:
Sub Savethep_w_upload()
Dim olApp As New Outlook.Application
Dim nmsName As Outlook.NameSpace
Dim vItem As Object
Set nmsName = olApp.GetNamespace("MAPI")
Set myFolder = nmsName.GetDefaultFolder(olFolderInbox)
Set fldFolder = myFolder.Folders("For Download")
For Each vItem In fldFolder.Items
'-----Save Attachment-------
For Each att In vItem.Attachments
att.SaveAsFile "D:\Email Attachment Temp\" & att.FileName
Next
'------Save Attachment--------
Next
Set fldFolder = Nothing
Set nmsName = Nothing
End Sub
4)点击“运行”。
转载于:https://blog.51cto.com/simondu/730919