Hi,
I'm trying to rename the file format for images in a folder on my directory.
I have a code that will loop thru the file. But, I have not had success in renaming the file.
The following is a code that I found and was trying to modify it.
The Image in the folder my be ".Png" or "jpg". I want to be able to save the Image to a new Image folder.
Any suggestion would be grateful.
Charles
I'm trying to rename the file format for images in a folder on my directory.
I have a code that will loop thru the file. But, I have not had success in renaming the file.
The following is a code that I found and was trying to modify it.
Code:
Sub LoopThroughFiles()
Dim MyObj As Object, MySource As Object, file As Variant
file = Dir("c:\testfolder\")
While (file <> "")
' If InStr(file, "test") > 0 Then
MsgBox "found " & file
file.SaveAs Filename:="C:\NewImagefolder.jpg"
' Exit Sub
' End If
file = Dir
Wend
End Sub
The Image in the folder my be ".Png" or "jpg". I want to be able to save the Image to a new Image folder.
Any suggestion would be grateful.
Charles