Printing lists of folder names under one name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have XP Windows 2003, I have created a named folder, such as Templates.1.
When I open it up I have a list of many folders with documents in them. What
I need to do is just print out the list of the folders, no documents, just
the names of the folders. What can I do?
 
The following macro will print the names of the folder in your specified path.

======================================================

Sub Folders()

Dim doc As Document
Dim strName As String
Dim strPath as string

Set doc = ActiveDocument
strPath = "C:\
strName = Dir(strPath vbDirectory)

Do Until strName = ""
Selection.Text = strName & vbCrLf
Selection.EndKey Unit:=wdStory
strName = Dir
Loop

Set doc = Nothing

End Sub
 
While Kevin's macro will do the job, see also the Printfolders utility
linked from the downloads page of my web site which will allow you to output
folder and file information in a variety of ways.
http://www.gmayor.com/downloads.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top