Method: GetExtensionName for FileSystemObject
- Updated2024-09-12
- 1 minute(s) read
FileSystemObject and Dictionary > Methods > Method: GetExtensionName for FileSystemObject
Method: GetExtensionName for FileSystemObject
Returns the part of the path that corresponds with the filename extension of a file.
sGetExtensionName = Object.GetExtensionName(Path)
| Object | FileSystemObject Object with this method |
| Path | String Specifies the path. The path must not correspond with an existing file. |
| sGetExtensionName | String Receives the filename extension. |
The following example specifies the filename extension in a path:
Function GetExtension(sDrive) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") GetExtension = fso.GetExtensionName(sDrive) End Function