View Single Post
 
Old 09-27-2016, 09:24 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

The date in the filename is the date and time the message is received in the inbox. As the message is not received if Outlook is not running then that date and time, as it stands, may not be the date that you want. You could instead get the date the mesage was sent e.g. Change
Code:
strFileName = Format(Date, "yyyymmdd-") & "(" & Format(Time, "HHMM) - ") & olAtt.FileName
to
Code:
strFileName = Format(Item.SentOn, "yyyymmdd-") & _
                              "(" & Format(Item.SentOn, "HHMM) - ") _
                              & olAtt.FileName
The last modified date is far more of an issue, because you cannot read that date from the attachment until it has been saved and then the act of saving it will, I guess, update that modified date.
__________________
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