我正在使用文件系统对象循环遍历一组目录,并且我想指定一个额外的目录来循环遍历。例如,我目前有:
Sub test()
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(Directory)
Set colSubfolders = objFolder.Subfolders
For Each objSubfolder In colSubfolders
' take some action
End For
End Sub
但是,我想指定一个额外的文件夹来循环,例如:
colSubfolders = colSubfolders + "additionalpath"
For Each objSubfolder In colSubfolders ....
或者,是否可以在循环命令中指定多个对象,例如:
For Each objSubfolder in colSubfolders, "additionalpath"