M
Michael Bond
Hello all
I need a little help please....
The following code populates a single column listbox on a
form with the files contained in a directory
Private Sub UserForm_Initialize()
Dim fs, f, f1, fc, S
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder("X:\")
Set fc = f.Files
ListBox1.ColumnCount = 1
ItemCount = 0
ItemTitle = 2
For Each f1 In fc
ListBox1.AddItem f1.Name
Next
End Sub
The idea is for the user to choose a file on which to
perform some work.
The problem?...the user does not always know the content
of the file. The file name is a string made up from the
date and time the file was created e.g. 121603_1542.xls
I want to add a second column in the list box which will
display some of the property attributes of the file e.g.
the title or the subject. The title/subject, or whatever
property I can access, can be used to hold a string which
shows the user some of the details of the file content
(for example the date range of the data it contains)
Can anyone help with the code to populate that second
column....or other suggestion to acheive my aim.
Appreciate any help.
Regards
Michael Bond
I need a little help please....
The following code populates a single column listbox on a
form with the files contained in a directory
Private Sub UserForm_Initialize()
Dim fs, f, f1, fc, S
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder("X:\")
Set fc = f.Files
ListBox1.ColumnCount = 1
ItemCount = 0
ItemTitle = 2
For Each f1 In fc
ListBox1.AddItem f1.Name
Next
End Sub
The idea is for the user to choose a file on which to
perform some work.
The problem?...the user does not always know the content
of the file. The file name is a string made up from the
date and time the file was created e.g. 121603_1542.xls
I want to add a second column in the list box which will
display some of the property attributes of the file e.g.
the title or the subject. The title/subject, or whatever
property I can access, can be used to hold a string which
shows the user some of the details of the file content
(for example the date range of the data it contains)
Can anyone help with the code to populate that second
column....or other suggestion to acheive my aim.
Appreciate any help.
Regards
Michael Bond