Sub Document_properties()
Dim filesystem As Object, myfolder As Object
Dim myfiles As Object, myfile As Object, Pastefile As Object
On Error Resume Next
Set filesystem = CreateObject("Scripting.filesystemobject")
Set myfolder = filesystem.getfolder("C:\Users\M210350\Documents\Test")
Set myfiles = myfolder.Files
Set Pastefile = filesystem.getfile("C:\Users\M210350\Documents\Test.xls")
Workbooks.Open Filename:="C:\Users\M210350\Documents\Test.xls"
A = 1
B = 1
For Each myfile In myfiles
Range("A" & A) = myfile.BuiltinDocumentProperties(1).Value 'Title
A = A + 1
Range("A" & A) = myfile.BuiltinDocumentProperties(2).Value 'Status
A = A + 1
Range("A" & A) = myfile.BuiltinDocumentProperties(3).Value 'Author
A = A + 1
Range("A" & A) = myfile.BuiltinDocumentProperties(4).Value 'Keywords
A = A + 1
Range("B" & B) = myfile.BuiltinDocumentProperties("Creation Date")
B = B + 1
Range("B" & B) = myfile.BuiltinDocumentProperties("Title")
B = B + 1
next
end sub
Set fs = CreateObject("Scripting.FileSystemObject")
SelectedFile = Application.GetOpenFilename("Excel files (*.txt), *.txt")
selectedFilePath = ""
While InStr(SelectedFile, "\") > 0
selectedFilePath = selectedFilePath & Left(SelectedFile, InStr(SelectedFile, "\"))
SelectedFile = Mid(SelectedFile, InStr(SelectedFile, "\") + 1)
Wend
Set oShell = CreateObject("Shell.Application")
Set objFolder = oShell.Namespace(selectedFilePath)
Set objFolderItem = objFolder.ParseName(SelectedFile)
fileCreator = objFolder.GetDetailsOf(objFolderItem, 10)
Sub retest_textfileproperties()
Dim sFile As Variant
Dim oShell: Set oShell = CreateObject("Shell.Application")
Dim oDir: Set oDir = oShell.Namespace("C:\Users\M210350\Documents\Testa") 'where the directory is that stores the text files.
For Each sFile In oDir.Items
MsgBox oDir.GetDetailsOf(sFile, 10) 'change msgbox to output where you want it.
Next
End Sub