Object: File
- Updated2024-09-12
- 1 minute(s) read
(Collections | FileSystemObject) > Files > Object: File
Object: File
You can use the File object to access the properties of a file.
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
Properties
Attributes | DateCreated | DateLastAccessed | DateLastModified | Drive | Name | ParentFolder | Path | ShortName | ShortPath | Size | Type
Methods
Copy | Delete | Move | OpenAsTextStream