devxlogo

GetFiles – Returns all the files in a directory

GetFiles – Returns all the files in a directory

' Returns a collection holding all the filenames that' match a given filespec and search attributes.Function GetFiles(filespec As String, Optional Attributes As VbFileAttribute) _    As Collection    Dim filename As String        Set GetFiles = New Collection        ' start the search    filename = Dir$(filespec, Attributes)        Do While Len(filename)        ' we've found a new file        GetFiles.Add filename, filename        ' get ready for the next iteration        filename = Dir$    LoopEnd Function

See also  Comparing different methods of testing your Infrastructure-as-Code
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist