I know how to use the FileDateTime function (which returns mmm/dd/yy tt:tt). I would like to know how I can get it to return the date the file was created in the format (Month Day, Year) completely spelled out (ex. October 5, 2000).
Thanks,
Brandr
Printable View
I know how to use the FileDateTime function (which returns mmm/dd/yy tt:tt). I would like to know how I can get it to return the date the file was created in the format (Month Day, Year) completely spelled out (ex. October 5, 2000).
Thanks,
Brandr
Try this..
hope this helpsCode:MyDate = Format(FileDateTime("c:\whatever.xxx"), "Long Date")
Shaun
Just be aware that FileDateTime is the last modified date/time not the created unless the file has not been modified.
Code:'file information using File Scripting Object (fso)
'date created...
Private Sub Form_Load()
Dim sFile As String
Dim myDate As String
sFile = "c:\my documents\try.txt"
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
myDate = fso.getfile(sFile).datecreated
myDate = Format(myDate, "Long Date")
MsgBox "The file " & sFile & " was created on: " & myDate
Unload Me
End Sub