GetExtensionName Method
Returns the extension (for example "txt" or "exe") of the last component in a path.
object.GetExtensionName(path)
For network drives, the root directory (\) is considered to be a component.
This method returns an empty string ("") if the file doe not exist.
The following example illustrates the use of the GetExtensionName method.
Function GetAnExtension(DriveSpec)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
GetAnExtension = fso.GetExtensionName(Drivespec)
End Function
Applies To:
Community Additions
Show: