Dear All,
I have created the below script that will allow me to delete the last 10 characters from the pdf filenames.
It's working - my only problem is that - I cannot find a way how to adjust it so that he do not delete as well the extension (.pdf) of these files... Could you please help me?
thanks in advance,
Sub ZeroOutMinutesInFilenames()
Dim LastDot As Long, Path As String, Filename As String, NewFilename As String
Path = "G:\MyDocuments\PDF"
Filename = Dir(Path & "*.pdf")
Do While Len(Filename)
LastDot = InStrRev(Filename, ".pdf")
NewFilename = Left(Filename, 10)
Name Path & Filename As Path & NewFilename
Filename = Dir()
Loop
End Sub
I have created the below script that will allow me to delete the last 10 characters from the pdf filenames.
It's working - my only problem is that - I cannot find a way how to adjust it so that he do not delete as well the extension (.pdf) of these files... Could you please help me?
thanks in advance,
Sub ZeroOutMinutesInFilenames()
Dim LastDot As Long, Path As String, Filename As String, NewFilename As String
Path = "G:\MyDocuments\PDF"
Filename = Dir(Path & "*.pdf")
Do While Len(Filename)
LastDot = InStrRev(Filename, ".pdf")
NewFilename = Left(Filename, 10)
Name Path & Filename As Path & NewFilename
Filename = Dir()
Loop
End Sub