filelistbox question 
Author Message
 filelistbox question

Is it possible to have a filelistbox list just the document name minus the
extention? If so, how?

Thanks.
Irvin.



Mon, 01 Aug 2005 10:38:51 GMT  
 filelistbox question
One way would be to create a parsing subroutine or procedure. Using InStr,
Left and Right string functions you could search for the first fullstop in
the filename and then strip the rest.

-----------------------------------------
Jeff Watkins
Labrug - Computer Consultant and Trainer

040809 4899

Quote:
> Is it possible to have a filelistbox list just the document name minus the
> extention? If so, how?

> Thanks.
> Irvin.



Mon, 01 Aug 2005 14:13:33 GMT  
 filelistbox question
I think you'd do better to search for the *last* full stop in the
filename, using InStrRev().

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


Quote:
> One way would be to create a parsing subroutine or procedure. Using
InStr,
> Left and Right string functions you could search for the first
fullstop in
> the filename and then strip the rest.

> -----------------------------------------
> Jeff Watkins
> Labrug - Computer Consultant and Trainer

> 040809 4899


> > Is it possible to have a filelistbox list just the document name
minus the
> > extention? If so, how?

> > Thanks.
> > Irvin.



Tue, 02 Aug 2005 04:20:36 GMT  
 filelistbox question
Dirk,

Am I correct in assuming I can get the contents of the listbox as an array
using the name of the listbox in something like foreach, stripping
everything past and including the 'dot', and re-assigning it back to the
array?

Irvin.



Tue, 02 Aug 2005 06:01:48 GMT  
 filelistbox question

Quote:
> Dirk,

> Am I correct in assuming I can get the contents of the listbox as an
array
> using the name of the listbox in something like foreach, stripping
> everything past and including the 'dot', and re-assigning it back to
the
> array?

I'm not sure what type of control we're talking about here, so I must
ask you to clarify.  This newsgroup is devoted to programming for
Microsoft Access, so you may be talking about an Access listbox
control (presumably loaded with a list of files), but you said
"filelistbox", which is the name of a VB control.  They're different
animals;  which do you mean?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)



Tue, 02 Aug 2005 06:22:57 GMT  
 filelistbox question
Dirk,
I am refering to the VB6 file list box. It looks like I may have improperly
posted to the wrong newsgroup. My appologies.
Irvin.


Quote:


> > Dirk,

> > Am I correct in assuming I can get the contents of the listbox as an
> array
> > using the name of the listbox in something like foreach, stripping
> > everything past and including the 'dot', and re-assigning it back to
> the
> > array?

> I'm not sure what type of control we're talking about here, so I must
> ask you to clarify.  This newsgroup is devoted to programming for
> Microsoft Access, so you may be talking about an Access listbox
> control (presumably loaded with a list of files), but you said
> "filelistbox", which is the name of a VB control.  They're different
> animals;  which do you mean?

> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com

> (please reply to the newsgroup)



Tue, 02 Aug 2005 12:09:53 GMT  
 filelistbox question
No problem, Irvin.  I can still have a go at answering your question.
You can loop through the contents of the FileListBox control using
code like this:

    Dim I As Integer

    For I = 0 To File1.ListCount - 1
        Debug.Print File1.List(I)
    Next I

You could have an array, which you could fill by looping through the
listbox like this, and as you said you could strip off the extensions
using InStrRev(astrFileName(I), ".") to find the last dot.  You'd need
to beware, of course, of files that have no extensions.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


Quote:
> Dirk,
> I am refering to the VB6 file list box. It looks like I may have
improperly
> posted to the wrong newsgroup. My appologies.
> Irvin.





> > > Dirk,

> > > Am I correct in assuming I can get the contents of the listbox
as an
> > array
> > > using the name of the listbox in something like foreach,
stripping
> > > everything past and including the 'dot', and re-assigning it
back to
> > the
> > > array?

> > I'm not sure what type of control we're talking about here, so I
must
> > ask you to clarify.  This newsgroup is devoted to programming for
> > Microsoft Access, so you may be talking about an Access listbox
> > control (presumably loaded with a list of files), but you said
> > "filelistbox", which is the name of a VB control.  They're
different
> > animals;  which do you mean?

> > --
> > Dirk Goldgar, MS Access MVP
> > www.datagnostics.com

> > (please reply to the newsgroup)



Tue, 02 Aug 2005 13:08:53 GMT  
 filelistbox question
Thanks Dirk.

That looks like the ticket. I've never seen the FOR statement constructed
the way you did, but I do see what it's doing. Very compact. Cool! I have
some other things to take care of before I can actually put this to work so
I'll sign off on this question for now. Thanks again for your help.

Irvin Amoraal.



Tue, 02 Aug 2005 19:45:45 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. FileListBox Question!?

2. FileListBox question

3. FileListBox question

4. FileListBox question

5. FileListBox Question

6. playing wavs in filelistbox question

7. quick FileListBox question

8. FileListBox Question

9. QUESTION: copying files from filelistbox

10. Question on FileListBox control

11. using DirListBox , FileListBox and DriveListBox in a2k

12. DirListBox, FileListBox in a form????

 

 
Powered by phpBB® Forum Software