您好,能给段VB代码吗?就是获取文件夹下所有文件名
发布网友
发布时间:2023-10-26 16:43
我来回答
共1个回答
热心网友
时间:2024-04-01 02:18
'点菜单(工程)下的(引用),勾选(Microsoft Scripting Runtime)确认
Private Sub Command1_Click()
List1.Clear
Dim fso As New FileSystemObject
Dim f As File
Dim fd As Folder
Set fd = fso.GetFolder(App.Path & "\文件")
For Each f In fd.Files
List1.AddItem f.Path
List1.AddItem f.Name
Next
End Sub