[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Fill ListBox with File Names given Path

I need to fill a Listbox with the Names of Files in a Directory. I want code, I dont want to use a filelistbox.
0
fred12
Asked:
fred12
1 Solution
 
OeilNoirCommented:
this will do what you want... when you call the "dir" function without parameters, the dir function return the next file matching the patern....

dim strFile as string

strfile = dir("c:\path\*.*")
do while strfile <> ""
   list1.additem strfile
   strfile = dir
loop
   
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now