devxlogo

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

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Seven Service Boundary Mistakes That Create Technical Debt

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.