Private fso As New Scripting.FileSystemObject
Private Sub EnumFolders(Path As String)
On Error GoTo errhdl
Dim fsf1 As File
Dim fsl1 As Folder
For Each fsl1 In fso.GetFolder(Path & "\").SubFolders
ActiveDocument.Content.InsertAfter fsl1.Path & vbCrLf
Call EnumFolders(Path & "\" & fsl1.Name)
Next fsl1
For Each fsf1 In fso.GetFolder(Path & "\").SubFolders
ActiveDocument.Content.InsertAfter fsf1.Path & vbCrLf
Next fsf1
errhdl:
End Sub
public sub PrintList()
dim spath as string
spath = inputbox("Введите путь:")
if len(spath)>0 then
enumfolders(spath)
activedocument.printout
end if
end sub
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 59