ChangeFileExt

Top  Previous  Next

function ChangeFileExt(sFileName As String, sDotNewFileExt As String) As String

 

ChangeFileExt takes the filename specified in sFileName and changes the file extension to the new extension passed in sDotNewFileExt.

 

sDotNewFileExt specifies the new extension, including the initial dot character.

 

ChangeFileExt does not rename the actual file, it just creates a new file name string.

 

Parameters

 

sFileName ... String expression.
sDotNewFileExt ... New file extension including the leading dot character.

 

Example:

Dim s

 

= ChangeFileExt("e:\exp\rules.htm", ".txt")

' returns s = "e:\exp\rules.txt"




Translate document: