Copy the "Title" Field from windows explorer to excel?

A

andrew.ewing

Im trying to copy the "title" field along with the "filename" into
excel. Im able to copy the filename field via a batch file using the
Dir command, but it doesnt allow you to copy the other fields that are
in the explorer window. Is there a a way to do this?

Thanks in advance
 
C

Chip Pearson

I tend to use the Scripting FileSystemObject to get this sort of
info. In VBA, go to the Tools menu, choose References, and select
"Microsoft Scripting Runtime". Then, use code like

Dim FSO As Scripting.FileSystemObject
Dim F As Scripting.File
Set FSO = New Scripting.FileSystemObject
Set F = FSO.GetFile("H:\Test.txt")
Debug.Print F.Path
Debug.Print F.Name
Debug.Print F.Size
' other attributes of F

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top