Property: DateCreated for File
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Properties > Property: DateCreated for File
Property: DateCreated for File
Specifies the file creation date and time.
Set oDispatch = Object.DateCreated
| Object | File Object with this property |
| oDispatch | Returned object Receives the creation date as variant value with the subtype date. |
The following example displays various file information:
Function ShowFileInfo(sFile) Dim fso, oMyFile, sOutput Set fso = CreateObject("Scripting.FileSystemObject") Set oMyFile = fso.GetFile(sFile) sOutput = "File: " & oMyFile.Name & VBCrLf sOutput = sOutput & "Created: " & oMyFile.DateCreated & VBCrLf sOutput = sOutput & "Last Accessed: " & oMyFile.DateLastAccessed & VBCrLf sOutput = sOutput & "Last Modified: " & oMyFile.DateLastModified ShowFileInfo = sOutput End Function