Can I save attachments with rules wizard?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top