Property: Name for File
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Properties > Property: Name for File
Property: Name for File
Specifies the name of a file.
Object.Name
| Object | File Object with this property |
| Object.Name | String with read and write access |
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