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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print directory listing?

Status
Not open for further replies.

gymbeef

Technical User
Sep 18, 2002
33
0
0
US
This isn't an Access or VBA question, but this is the only forum I read or post to, plus I'm not sure where I'd ask this otherwise. Simple problem, but it has me a little stumped and surprised I haven't run across it before:

I saved a bunch of demos, shareware, and freebies which I collected from various forums. I saved them under descriptive filenames (e.g." Utility to compact database") and I just wanted to print the directory list to get a simple "table of contents" listing what tools and tips I have. Windows explorer doesn't have a "print" command in their menu. I tried looking under "My computer", but again no "print" selection in the menu or under the right-mouse-click menu. Tried IE, but no help there either.

So how do I print a simple directory listing?
 
Hi!

One thing you can do is open explorer and bring up the list you want to print and press Shift/Print Screen. Open Word or Paint etc. and paste. You will have a picture of explorer in you app that you can print out.

hth


Jeff Bridgham
bridgham@purdue.edu
 
If you wanted to write the code to do it, you could get all the file names by doing the below (seaches for an file with the extension .pl, in C:\Perl\Scripts, and outputs to a text file called Output in C:\Temp.

Code:
Function fncGetFiles()
Dim strName As String ' name of dir
Dim fsTemp as Object
Dim fTemp as Object

Set fsTemp = CreateObject("Scripting.FileSystemObject")
Set fTemp = fsTemp.CreateTextFile("C:\Temp\Output.txt")

strName = Dir("C:\Perl\Scripts\*.pl")

While Not strName = ""   
    fTemp.WriteLine(strName)
    strName = Dir
Wend

MsgBox "Finished Writing File Names"
 
End Function

HTH!

Mincefish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top