获取文件夹下所有文件

Sub ShowFileList()
Dim fs, f, f1, fc, s
Dim folderspec As String

folderspec = "C:Usersofu1DesktopA帳票設計書修正設計書_SRA16_BK"


Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.Files
For Each f1 In fc
MsgBox f1.Name
Next

End Sub

原文地址:https://www.cnblogs.com/zerotomax/p/6678894.html