Sub Example_patterns() ExampleDir ("*") ExampleDir ("*E*") ExampleDir ("*e*") End Sub Sub ExampleDir(pattern$) ' Displays all files and directories Dim sPath As String Dim sDir As String, sValue As String sDir = "Directories:" sPath = "C:\Program Files\LibreOffice\program\" 'CurDir sValue = Dir$(sPath + getPathSeparator + pattern, 16) Do If sValue <> "." And sValue <> ".." Then If (GetAttr(sPath + getPathSeparator + sValue) And 16) > 0 Then ' Get the directories sDir = sDir & Chr(13) & sValue End If End If sValue = Dir$ Loop Until sValue = "" MsgBox sDir, 0, sPath End Sub