如何以编程方式从outlook保存附件?

时间:2014-03-26 13:27:36

标签: outlook

我每天早上8点收到一封附有.xlsx附件的电子邮件。我需要outlook 2010将此附件保存到桌面上的文件夹中。我怎么能这样做?

1 个答案:

答案 0 :(得分:0)

点击Alt + F11 - >打开一个新模块 - >

Public Sub saveAttachtoDisk (myItem As Outlook.MailItem)
Dim myAttachment As Outlook.Attachment
Dim saveFolder As String
'change xxx to your folder's name
saveFolder = “c:xxx”
For Each myAttachment In myItem.Attachments
myAttachment.SaveAsFile saveFolder & “\” & myAttachment.DisplayName
Set myAttachment = Nothing
Next
End Sub

然后创建一个新规则以将此脚本应用于您的接收者