Save E-mail attachments in a specific folder

jeremycadoret

New Member
Outlook version
Outlook 2016 64 bit
Email Account
POP3
Hi guys,

I have the following code that is supposed to save any attachment in a specific folder (C:\Users\mails):

Code:
Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "C:\Users\mails"
For Each oAttachment In MItem.oAttachments
oAttachment.SaveAsFile sSaveFolder & oAttachment.DisplayName
Next
End Sub
I then created a rule related to the code which saved in ThisOutlookSession but it doesn't work and macros are enabled. What am I doing wrongly ? What is blocking ?

Thank you very much,

Jeremy
 
Top