WindsorKnot
Board Regular
- Joined
- Jan 4, 2009
- Messages
- 160
Hi All,
I need help printing all the files in a particular directory. I have the code below to open all the files in a directory but not to print
Any ideas?
I need help printing all the files in a particular directory. I have the code below to open all the files in a directory but not to print
Any ideas?
Code:
Sub OpenFolder()
Dim fileList() As String, fName As String, fPath As String, i As Integer
fPath = "C:\Documents and Settings\windsor11\Desktop\Accounting"
fName = Dir(fPath & "*.xls")
While fName <> ""
i = i + 1
ReDim Preserve fileList(1 To i)
fileList(i) = fName
fName = Dir()
Wend
If i = 0 Then
MsgBox "No files found"
Exit Sub
End If
For i = 1 To UBound(fileList)
Workbooks.Open fPath & fileList(i)
Next i
End Sub