Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to modify lastmodifieddate of a file 2

Status
Not open for further replies.

barny2006

MIS
Mar 30, 2006
521
US
hi,
somebody has saved a file on a directory, somehow with last modified date of 11/28/2057! when a directory is dispayed, this file stays on the very top.
is there anyway to modify this data? i understand fso.name is modifyable. is the date modifyable also?
thanks.
 
Edit it & re-save it?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
it's a powerpoint show file (pps). i don't know of anyway to edit it. any ideas?
 
i don't know of anyway to edit it
Open it with PP and use SaveAs ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
You can change the "Last Modified" date using the Shell.Application object.

Code:
ModFileDT "c:\temp", "test.ppt", Now - 5
ModFileDT "c:\temp", "test.txt", "1/17/2007 4:18:02 PM"

Function ModFileDT(strDir, strFileName, DateTime)
' 	On Error Resume Next
	
	Dim objShell, objFolder
	
	Set objShell = CreateObject("Shell.Application")
	Set objFolder = objShell.NameSpace(strDir)
	objFolder.Items.Item(strFileName).ModifyDate = DateTime
End Function

--------------------------------------------------------------------------------
dm4ever
My philosophy: K.I.S.S - Keep It Simple Stupid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top