View Single Post
 
Old 04-01-2020, 08:55 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,105
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

I don't think you can address ReportItem directly from VBA without third party software so the line should be
Code:
If TypeName(Item) = "MailItem" Then
If Item is classed as Object then this should go directly after For Each e.g.

Code:
For Each Item In olSubFolder.Items
    If TypeName(Item) = "MailItem" Then
        If Item.Attachments.Count > 0 then
           'Do stuff
__________________
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