Import File Information

Joined
Jan 16, 2018
Messages
1
Reaction score
0
Hello,

I'm trying to Use access to load all the information of files I have on a server into one table.

SO if I have:
file "a" with create date "X1", description "Y1", tags "Z1"
file "b" with create date "X2", description "Y2", tags "Z2"
file "c" with create date "X3", description "Y3", tags "Z3"

I would like one table that has 3 rows and a column for each of these items. I've been able to somewhat create this with a module:

Option Compare Database

Sub GetFiles(strPath As String)
Dim rs As Recordset
Dim strFile As String, strDate As Date, strType As String, strTags As String


'clear out existing data
CurrentDb.Execute "Delete * From tblDirectory", dbFailOnError

'open a recordset
Set rs = CurrentDb.OpenRecordset("tblDirectory", dbOpenDynaset)

'get the first filename
strFile = Dir(strPath, vbNormal)
'Loop through the balance of files
Do
'check to see if you have a filename
If strFile = "" Then
GoTo ExitHere
End If
strDate = FileDateTime(strPath & strFile)
strTags = FileTags
rs.AddNew
'to save the full path using strPath & strFile
'save only the filename
rs!FileName = strFile
rs!FileDate = strDate
rs!Tag = strTags
rs.Update

'try for next filename
strFile = Dir()
Loop

ExitHere:
Set rs = Nothing
MsgBox ("Directory list is complete.")
End Sub

But i haven't figured out how to get tags, descriptions, subject, category, title, etc from each file to sit on the table. I don't really know how to finish the code, or the "calltags" for these items to appear. Any advice would help
 
Back
Top