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?
Kevin B - 16 Feb 2006 17:51 GMT
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

Signature
Kevin Backmann
> 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?
Graham Mayor - 17 Feb 2006 06:54 GMT
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

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> 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?