我已将此脚本复制为从邮件到文件夹的单独附件。
Public Sub ProcessarAnexo(Email As MailItem)
Dim diretorioAnex As String
diretorioAnex = "C:\Separados"
Dim MailID As String
Dim mailx As Outlook.MailItem
MailID = Email.EntryID
Set Mail = Application.Session.GetItemFromID(MailID)
For Each anexo In mailx.Attachments
If Rigth(anexo.FileName, 3) = "xml" Then
MsgBox (anexo.FileName)
anexo.SaveAsFile directorioanex & "\" & anexo.FileName
End If
Next
Set mailx = Nothing
End Sub
我尝试从“立即执行规则”执行脚本,但它不会在“Separados”文件夹中保存任何内容。
答案 0 :(得分:0)
该脚本有效,Outlook 2010已阻止宏和代码,我已启用OutLook来运行VBA和宏,所有运行正常。
由于