Re: How to get file names



On Tue, 28 Feb 2006 14:23:08 GMT, "RICHARD BROMBERG"
<dickbrom@xxxxxxxxxxxxxxxx> wrote:

I am writing a slide show program.

I will create an array and the array elements will be populated with the
file name of each image file (jpg, bmp, etc) in the directory.

For simplicity the image files can be assumed to be in the same directory as
the program.

The program will use the array to display each image one after the other and
then start over again at the beginning of the array.

Can anyone suggest how to access the names so I can save them in the array.
I will test the file names to make sure that only graphic files get entered
into the array.

Simplest is.. Stick a filelistbox on your form, set it's visible
property to false to hide it, when happy with it.

file1.path = App.path
file1.pattern = "*.jpg;*bmp;*.png;*.etc"
for i = 0 to file1.listcount -1
debug.print file1.list(i)
next

Won't even need the array then, since the filelist is just that and
the filelistbox is a standard Windows component, so no need to worry
about distribution problems..

--

Regards, Frank
.


Quantcast