Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print folder contents

Status
Not open for further replies.
Jan 26, 2007
3
GB
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top