chandrashekar
Well-known Member
- Joined
- Jul 15, 2005
- Messages
- 529
- Office Version
- 365
- Platform
- Windows
Hello,
Have written below code in Outlook and enabled rules option in outlook(Run option).
But still not recognizing the code. Let me know if am missing anything here
Have written below code in Outlook and enabled rules option in outlook(Run option).
But still not recognizing the code. Let me know if am missing anything here
VBA Code:
Public Sub saveAttachtoDisk(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Mail_subj = "*Test mail*"
saveFolder = "D:\My Documents\Test_Emails Attachment\"
For Each objAtt In itm.Attachments
subj = itm.Subject
comp = subj Like Mail_subj
If comp = True Then
objAtt.SaveAsFile saveFolder & objAtt.DisplayName
Set objAtt = Nothing
End If
Next
End Sub
Last edited by a moderator: