保存邮件附件后运行应用程序

时间:2015-07-04 18:30:49

标签: vba outlook outlook-vba

在使用以下脚本保存附件后需要运行应用程序。

如何调用它后结束子?

Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
    Dim objAtt As Outlook.Attachment
    Dim saveFolder As String
    saveFolder = "C:\New folder\tmp\"
    For Each objAtt In itm.Attachments
         objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
         Set objAtt = Nothing
    Next
End Sub

1 个答案:

答案 0 :(得分:0)

在VBA中打开应用程序

Sub OpenApp()
    Dim x As Variant
    Dim Path As String

    '// Application Path
    Path = "C:\Program Files\blabla.exe"

    x = Shell(Path, vbNormalFocus)
End Sub