'filter is a string that will be used to match files i.e. use "*.pdf" to match all PDF files or "a*.pdf" to match all PDF files that start with "a"
'you can also specify certain file names or use other wildcard values like this: "??.pdf" which will find all PDF files named with two characters
'path is a fully qualified path to the location of the files that should be searched i.e. "C:\Users\User\Documents\"
'newExtension is the extension you want the files to have when the rename is done i.e. ".pdfold"
Public Sub RenameFiles(ByVal filter As String, ByVal path As String, ByVal newExtension As String)
Dim fn As String
fn = Dir(path & filter)
While (fn <> "")
nfn = Left(fn, Len(fn) - 4) & Format(Now(), "_yyyyMMddhhmmss") & newExtension
Name path & fn As path & nfn
fn = Dir()
Wend
End Sub