Re: FileListBox

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Dave (Nobody_at_Nowhere.Com)
Date: 11/08/04


Date: Mon, 8 Nov 2004 11:44:36 -0000


"Martin Walke" <martin.walke@spamvega.co.uk> wrote in message
news:eFluwpXxEHA.4028@TK2MSFTNGP15.phx.gbl...
> Hi David,
>
> Instead of the FileList, you could use the Dir() function.
>
> FName = Dir(<directoryname>, vbNormal)

or even:

FName = Dir(<directoryname> & "\*.*", vbNormal)

Even better is FindFirst,FindNext & FindClose - But that is whole different
game :-)

Dave

>
> do while FName <> ""
> :
> processing here
> FName = Dir()
> loop
>
>
> Check the example in the VB Help
>
> HTH
> Martin
>
>
> "David" <drs58@msn.com> wrote in message
> news:c5e774e3.0411071048.ab218f4@posting.google.com...
>> I'm trying to change the names of files in a particular directory.
>> After specifying the directory, the user specifies a search string to
>> find in the filenames along with the string to replace it with. Based
>> on this, I want to cycle through a FileListBox, looking at each
>> filename, changing the name of those files that are found to contain
>> the search string. (I'm using the FileListBox since I can't locate a
>> function that returns a collection of filenames from a directory.)
>>
>> I'm having a problem figuring out how to cycle through the file list.
>> FileListBox. The following generates an 'Improper property array
>> index' error:
>>
>> filFileList.ListIndex = i (i is a couter incremented within a for/next
>> loop)
>>
>> Thanks,
>> David
>
>



Relevant Pages

  • Re: FileListBox
    ... the user specifies a search string to ... > find in the filenames along with the string to replace it with. ... > on this, I want to cycle through a FileListBox, looking at each ... > I'm having a problem figuring out how to cycle through the file list. ...
    (microsoft.public.vb.general.discussion)
  • Re: FileListBox
    ... Try Step -1 to go backwards through the list, collection, array, etc... ... the user specifies a search string to ... > find in the filenames along with the string to replace it with. ... > on this, I want to cycle through a FileListBox, looking at each ...
    (microsoft.public.vb.general.discussion)
  • FileListBox
    ... the user specifies a search string to ... find in the filenames along with the string to replace it with. ... on this, I want to cycle through a FileListBox, looking at each ...
    (microsoft.public.vb.general.discussion)
  • Re: FileListBox
    ... FName = Dir ... > find in the filenames along with the string to replace it with. ... > on this, I want to cycle through a FileListBox, looking at each ...
    (microsoft.public.vb.general.discussion)