Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 09-27-2016, 09:24 PM
gmayor's Avatar
gmayor gmayor is offline Saving Attachment Automatically Windows 10 Saving Attachment Automatically Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Saving Outlook attachment Via Excel code charlesdh Excel Programming 1 01-04-2016 11:55 AM
Saving Attachment Automatically Automatically print password protected pdf attachment teegs42 Outlook 1 12-19-2014 07:51 PM
Word 2010 not saving automatically darrylmarshall Word 1 06-07-2012 02:36 PM
Saving Attachment Automatically email as pdf attachment - subject line and attachment named after mail merge Nexus Mail Merge 12 04-13-2011 11:34 PM
Objective: Automatically export email text,attachment text to DB friendly format SilentLee Outlook 0 11-14-2010 02:45 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:54 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft