View Single Post
 
Old 03-01-2017, 07:31 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

How about

Code:
Public Sub Save_APPS(itm As Outlook.MailItem)
Dim objAtt As Outlook.Attachment
Dim saveFolder As String
Dim vExt As Variant
    saveFolder = "P:\Data\"
    For Each objAtt In itm.Attachments
        If InStr(objAtt.fileName, ".xls") Then
            vExt = Split(objAtt.fileName, Chr(46))
            objAtt.SaveAsFile saveFolder & "\" & _
                              Left(objAtt.fileName, 5) & _
                              Chr(46) & vExt(UBound(vExt))
        End If
    Next
    Set objAtt = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote