i have the following piece of code all I need is to find the file with extension PNG and most recent last modified date, I am able to find the last modified date, but if I place check of extension over file it gives error of [Object needed 'recentFile' at line [some number]]
SCRIPT
For Each objFile in colFiles
' Finds the latest modified file in folder
if (recentFile is nothing) then
Set recentFile = objFile
elseif (objFile.DateLastModified > recentFile.DateLastModified) then
Set recentFile = objFile
end if
Next
I know I can check extension later on but the issue is that what if there is a file which is latest and is not PNG? while there are files with PNG extension but not latest as compare to other files, so I just need to find PNG with last modified date to latest for only PNG files, please help how can I implement it?