I'm not sure what exactly you want, but if you have the path to the file
in a string variable or text box, you can use the FileDateTime function
to return the last-modified date of that file into a date/time field or
variable.
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oF = oFSO.GetFile("D:\My folder\File.TXT")
Debug.Print F.DateCreated
Debug.Print F.DateLastModified
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oF = oFSO.GetFile("D:\My folder\File.TXT")
Debug.Print F.DateCreated
Debug.Print F.DateLastModified
That's a good suggestion, if one needs the created-date, as distinct
from the last-modified date. I don't think I'd want to incur the
overhead of creating a FileSystemObject if all that's wanted is the the
last-modified date, since that's available via a built-in VBA function.
1 the date the file was created
2 the date the file was last modified
3 the date in file's "Date Picture Taken" property
4 the date the picture was actually taken?
1 and 2 can be retrieved as shown elsewhere in this thread.
For 3, you need to dig into the EXIF (or DCF) properties which modern
digital cameras include in their files. There's some code here http://sourceforge.net/projects/exifclass/ which can probably be used or
adapted for VBA, or you may find something by googling.
Finally, there's no guarantee that any of 1,2 and 3 is the same as 4!
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.