4

I'm trying to grab the date that a specific text file was uploaded onto the computer. The date isn't in the actual text file, instead you have to right-click then go to properties to view the date. I need to read the date into a variable.

I have no idea where to start to try and get this done.

Thank you,

Jesse Smothermon

Jesse Smothermon
  • 1,041
  • 10
  • 25
  • 36

1 Answers1

6

If the built in FileDateTime() isnt what your after you can use the FSO:

Dim FSO As Object: Set FSO = CreateObject("Scripting.FileSystemObject")
Dim objFile As Object: Set objFile = FSO.Getfile("C:\bleep\bloop.file")

Debug.Print "Date created: " & objFile.DateCreated
Debug.Print "Date last accessed: " & objFile.DateLastAccessed
Debug.Print "Date last modified: " & objFile.DateLastModified

If its a date in an extended attribute check this out.

Community
  • 1
  • 1
Alex K.
  • 171,639
  • 30
  • 264
  • 288