Public Sub saveAttToDisk(item As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
saveFolder = "C:\YourFolder\" 'change path as you wish
For Each objAtt In item.Attachments
If Right$(objAtt.DisplayName, 3) = "png" Then 'in this case all files with extension "png" will be excluded (this excludes signatures)
GoTo LastLine
Else
objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
Set objAtt = Nothing
End If
LastLine:
Next
End Sub
Part of the code below
For Each objAtt In item.Attachments
If Right$(objAtt.DisplayName, 3) = "png" Then 'in this case all files with extension "png" will be excluded (this excludes signatures)
GoTo LastLine
Else
If Right$(objAtt.DisplayName, 3) = "jpg" Then 'in this case all files with extension "jpg" will be excluded (this excludes signatures)
GoTo LastLine
Else
If Right$(objAtt.DisplayName, 4) = "jpeg" Then 'in this case all files with extension "jpeg" will be excluded (this excludes signatures)
GoTo LastLine
Else
If Right$(objAtt.DisplayName, 3) = "bmp" Then 'in this case all files with extension "bmp" will be excluded (this excludes signatures)
GoTo LastLine
Else
objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName
Set objAtt = Nothing
End If
End If
End If
End If