Hi again,
Does anyone know how to change file extension?
Please help me.
Thank You
Hi again,
Does anyone know how to change file extension?
Please help me.
Thank You
Jump to PostTry this :
Public Function ChangeFileExt(ByVal FileName As String, ByVal Extention As String) Dim str() As String, NewFile As String If InStr(1, FileName, ".") Then str = Split(FileName, ".") NewFile = Replace(FileName, str(UBound(str)), Extention) Name FileName As NewFile Else Name FileName As FileName & "." & Extention …
Try this :
Public Function ChangeFileExt(ByVal FileName As String, ByVal Extention As String)
Dim str() As String, NewFile As String
If InStr(1, FileName, ".") Then
str = Split(FileName, ".")
NewFile = Replace(FileName, str(UBound(str)), Extention)
Name FileName As NewFile
Else
Name FileName As FileName & "." & Extention
End If
End Function
Private Sub Command1_Click()
Call ChangeFileExt("D:\test.jx", "txt")
End Sub
Wow..thats really awesome codes sir..
Thank you very much.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.