Z
zSplash
I am trying to add ".doc" extension to text files (that have no extension),
but I'm missing the boat. All the files in C:\TextFiles need the extension.
I have unsuccessfully tried this:
Sub renameFiles()
Dim sDir As String, sFilename As String
sFilename = Dir("C:\TextFiles\*.*")
sDir = "C:\TextFiles\*.*"
Do While sFilename <> ""
Name sDir + sFilename As sDir + sFilename + ".doc"
'get to next file
sFilename = Dir()
Loop
End Sub
and this:
Sub renameFiles2()
Dim lsFileName, thePath As String
lsFileName = Dir("C:\TextFiles\*.*")
thePath = "C:\TextFiles\"
Do While lsFileName <> ""
'add extension to filename
lsFileName = FileName & ".doc"
lsFileName = Dir()
Loop
End Sub
Will someone please (re)direct me/help?
TIA
but I'm missing the boat. All the files in C:\TextFiles need the extension.
I have unsuccessfully tried this:
Sub renameFiles()
Dim sDir As String, sFilename As String
sFilename = Dir("C:\TextFiles\*.*")
sDir = "C:\TextFiles\*.*"
Do While sFilename <> ""
Name sDir + sFilename As sDir + sFilename + ".doc"
'get to next file
sFilename = Dir()
Loop
End Sub
and this:
Sub renameFiles2()
Dim lsFileName, thePath As String
lsFileName = Dir("C:\TextFiles\*.*")
thePath = "C:\TextFiles\"
Do While lsFileName <> ""
'add extension to filename
lsFileName = FileName & ".doc"
lsFileName = Dir()
Loop
End Sub
Will someone please (re)direct me/help?
TIA