I used an Outlook Rule function to determine all the emails that I receive from this "X" email address and the Rule is set-up in such a way that it will run a VBA script when the rules scriteria is found (see below VBA script).
The problem that I am having with this VBA script is that only the last email attachment gets saved from "X" user. Meaning the Rule will be applied to all the emails, however the VBA code - which is intended to save the attachments of each email - only saves the last email's attachment.
'''
Public Sub SaveAttachmentsToDisk(MItem As Outlook.MailItem)
Dim oAttachment As Outlook.Attachment
Dim sSaveFolder As String
sSaveFolder = "L:\my file path I save the PDFs to\"
For Each oAttachment In MItem.Attachments
oAttachment.SaveAsFile sSaveFolder & "\Signature -" & i & ".pdf" 'oAttachment.DisplayName
Set oAttachment = Nothing
Next
End Sub
'''
I even tried renaming the PDFs so that VBA does not have an issue with re-saving the same name on top of the previous PDF, but this did not help - issue still persists and only last email attachment gets saved. Please help :)
'''
Public Sub saveAttachtoDisk2(itm As Outlook.MailItem)
Dim objtest As Outlook.Application
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim x As Integer
saveFolder = "L:\L:my file path I save the PDFs to\"
x = 1
For Each objAtt In itm.Attachments
objAtt.SaveAsFile saveFolder & "\Signature - " & x '& objAtt.DisplayName
Set objAtt = Nothing
x = x + 1
Next
End Sub
'''