Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Contact us
Hide Buttons

FileSystemObject : GetExtensionName Method

Descrip­tion:

Returns exten­sion of a file, return empty string if file doesn’t exist.

Format : 

objectOf­FileSys­te­mOb­ject. GetExtensionName(filepath)

  • objectOf­FileSys­te­mOb­ject : As the names says, it’s a FileSystemObject.
Arguments: 
    • filepath
      • Manda­tory
      • Type:     String
      • filepath , whose exten­sion to be return.

Function FnGetExtensionName (strFilePath)
      Set fso = CreateObject("Scripting.FileSystemObject")
      strFileExtension = fso. GetExtensionName (strFilePath)      
      FnGetExtensionName = strFileExtension
End Function

Msg­box FnGe­tEx­ten­sion­Name (“c:\NewFolder\file.txt”)

 

 

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: