开发者

VBA Getting date from properties of a text file

开发者 https://www.devze.com 2023-03-05 01:02 出处:网络
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 开发者_如何学Cthen go to properties to vi

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 开发者_如何学Cthen 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消