Is there a way to read which files are in a folder, preferrably putting the filenames in a string.
Like:
VB Code:
Dim sFilenames() as String Object.Folder = "C:\Folder\" sFilenames() = Object.FilesInFolder
But then in a way that works.
Printable View
Is there a way to read which files are in a folder, preferrably putting the filenames in a string.
Like:
VB Code:
Dim sFilenames() as String Object.Folder = "C:\Folder\" sFilenames() = Object.FilesInFolder
But then in a way that works.
Quote:
Originally posted by arsmakman
Is there a way to read which files are in a folder, preferrably putting the filenames in a string.
Like:
VB Code:
Dim sFilenames() as String Object.Folder = "C:\Folder\" sFilenames() = Object.FilesInFolder
But then in a way that works.
try out FileSystemObject refer MSDN..... for examples
I tried MSDN, but got nonethewiser,Quote:
Originally posted by khalik_ash
try out FileSystemObject refer MSDN..... for examples
please post some code I can use for this.
Or rather than the API, you can use the DIR() function:
VB Code:
Private Sub Form_Load() Dim strPathToSearch As String Dim strCurrentPath As String strPathToSearch = "c:\" strCurrentPath = Dir(strPathToSearch, vbDirectory) Do While strCurrentPath <> "" If strCurrentPath <> "." And strCurrentPath <> ".." Then Text1.Text = Text1.Text & strCurrentPath & vbCrLf End If strCurrentPath = Dir Loop End Sub
Cool!
Thanx man!