Either use the following macro, or download the Printfolders tool from my
web site
Sub FolderContents()
On Error GoTo err_FolderContents
Set NewDoc = Documents.Add
Dim DocList As String
Dim DocDir As String
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)
Application.ScreenUpdating = False
With fDialog
.Title = "Select folder to save the copy and click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show <> -1 Then
MsgBox "Cancelled By User", , "List Folder Contents"
Exit Sub
End If
DocDir = fDialog.SelectedItems.Item(1)
If Right(DocDir, 1) <> "\" Then DocDir = DocDir + "\"
End With
DocList = Dir(DocDir & "*.doc", vbNormal)
Do While DocList <> ""
With Selection
.Style = "Normal"
.Font.name = "Times New Roman"
.Font.Size = "10"
.TypeText DocList & vbCr
End With
DocList = Dir
Loop
If NewDoc.Characters.Count = 1 Then
MsgBox "No documents found in selected folder", _
vbInformation, "No Data "
Exit Sub
End If
'Remove the next line if you do not want a two column layout
ActiveDocument.PageSetup.TextColumns.Add Width:=InchesToPoints(3)
ActiveWindow.ActivePane.View.Type = wdPageView
Application.ScreenUpdating = True
Exit Sub
err_FolderContents:
MsgBox Err.Description
Exit Sub
End Sub
http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>