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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I read properties on Text files?

Status
Not open for further replies.

JSchumacher

Technical User
Jun 17, 2001
31
US
I am trying to find the "last saved date" from a group of files. One is an Excel file and the others are .txt files. I was able to find the correct date for the Excel file using BuiltInDocumentProperties after using GetObject, but GetObject is not working on the text files. Do I need to specifiy a Class for text files, if so what is it? Is there a different method I could use? Here is the code used to find the dates of each file listed in a table and write the date to another field in the same table.

Private Function fImportFileData() As Boolean

Dim objFileName As Object
Dim db As DAO.Database
Dim rst As Recordset

Set db = CurrentDb
Set rst = db.OpenRecordset("tblImportLookUp")

Do While rst.EOF = False
Set objFileName = GetObject(rst.Fields(1))
rst.Edit
rst.Fields(3) = objFileName.BuiltInDocumentProperties.Item(12).Value
rst.Update
rst.MoveNext
Loop
Set objFileName = Nothing
End Function

Thanks!
Judie
 
Saving a text file changes the system date. You can use the FileDateTime function to retrieve the date.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top