Can I save attachments with rules wizard?

D

DareDelSol

I want to automatically save any kind of attachments in combination with
Rules Wizard - is there some kind of script that can set up? Is it VBA or
VBScripting?
Thanks anyone
 
D

DareDelSol

Here is the answer I was able to figure it out!

Put this in the Macro/VBA ThisOutlookSession:
---------------
Sub SaveAttMsgRule(Item As Outlook.MailItem)
If Item.Subject = "Test" Then
If Item.Attachments.Count > 0 Then
Dim objAttachments As Outlook.Attachments
Set objAttachments = Item.Attachments
For Each objAttach In objAttachments
' Does not handle duplicate filename scenarios
objAttach.SaveAsFile "C:\TEST\" & objAttach.FileName
Next
Set objAttachments = Nothing
End If
End If
End Sub
 
Top