Thread: [Solved] Downloading attachments
View Single Post
 
Old 05-20-2016, 08:45 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
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 ofgmayor has much to be proud of
Default

In that case change the following

Code:
For j = olItem.Attachments.Count To 1 Step -1
            Set olAttach = olItem.Attachments(j)
            If Not olAttach.FileName Like "image*.*" Then
                strFname = olAttach.FileName
                strExt = Right(strFname, Len(strFname) - InStrRev(strFname, Chr(46)))
                'strFname = FileNameUnique(strSaveFldr, strFname, strExt)
                If Not FileExists(strSaveFldr & strFname) Then
                    olAttach.SaveAsFile strSaveFldr & strFname
                End If
                'olAttach.Delete        'delete the attachment
            End If
        Next j
__________________
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