我已经复制了这个脚本,用于从邮件到文件夹的单独附件。
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”文件夹中保存任何内容。