Monday, March 23, 2009

Retrieve Extension names of the files

Hi ,
How to Retrieve Extension names of the files ?
Check it out with the below function .

Function GetAnExtension(Required_File)
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
GetAnExtension = fso.GetExtensionName(Required_File)
End Function

msgbox GetAnExtension("D:\Documents and Settings\Sree\Desktop\VBgrids.doc")


Output will be :



1 comment:

  1. thnak you. just eactly what i'm looking for

    ReplyDelete