sussexman38
MIS
Hi hoping that someone will be able to help me with this problem that has been taxing me for months.
I have the following code which allows the user to view folders in a list box.
Dim objFSO As Object, TargetFolder As Object, FC As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set TargetFolder = objFSO.GetFolder("C:\Documents and Settings\desktop\H&S")
Set FC = TargetFolder.SubFolders
HowMany = FC.Count
For Each File In FC
ListBox1.AddItem (File.Name)
Debug.Print File.Name
Next File
I want to be able to have a command button which will allow the user to select folder in the above list box and print its entire contents (word docs only) including any contents of subfolders.
I have the following code which allows the user to view folders in a list box.
Dim objFSO As Object, TargetFolder As Object, FC As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set TargetFolder = objFSO.GetFolder("C:\Documents and Settings\desktop\H&S")
Set FC = TargetFolder.SubFolders
HowMany = FC.Count
For Each File In FC
ListBox1.AddItem (File.Name)
Debug.Print File.Name
Next File
I want to be able to have a command button which will allow the user to select folder in the above list box and print its entire contents (word docs only) including any contents of subfolders.