ChangeFileExt

Top  Previous  Next

Sub ChangeFileExt($fileName As String, $newFileExt As String) As String

 

ChangeFileExt takes the filename specified in $fileName and changes the file extension to the new extension passed in $newFileExt.

 

$newFileExt 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

 

$fileName ... String expression.
$newFileExt ... New file extension including the leading dot character.

 

Example:

Dim $s

 

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

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