I think I am getting closer but cant figure out how to look for a specific jpg...in this example I am looking for a Filetype = "ESRI ArcMap Document".I can get this to to work with ESRI map document but cant figure out how to change that line to look for jpg files...I need "*" & variable & ".jpg"
Dim fso, theFolder, f1, fileCol, S
Dim folderName As String
Dim theFileType As String
Dim curFile As String
' In order to search for specific file types, you need to evaluate
' the files collection for files with a specific file description.
' This description can be found within Windows Explorer under the
' "Type" column
theFileType = "ESRI ArcMap Document" 'Add Type description here
folderName = "S:\GIS_Data\Users\Engineering\Projects\2010_PROJECTS" 'Add your path here
Set fso = CreateObject("Scripting.FileSystemObject")
Set theFolder = fso.GetFolder(folderName)
Set fileCol = theFolder.Files
For Each f1 In fileCol
curFile = f1.Name
If f1.Type = theFileType Then
'Enter custom code here
Dim File2 As String
File2 = curFile
frm_Outfalls_Images.ListBox1.AddItem (File2)
End If
Next
'MsgBox File2
frm_Outfalls_Images.Show