我需要使用VBA遍歷壓縮文件。特別是我需要,沒有解壓文件,找到以找到媒體子文件夾中XL文件夾。然後我需要將圖像從媒體子文件夾中複製出來並保存到另一個文件夾中。使用VBA遍歷壓縮文件
Public Sub Extract_Images()
Dim fso As FileSystemObject
Dim objFile As File
Dim myFolder
Const zipDir As String = "\\...\ZIP FILES"
Const xlFolder As String = "xl"
Const mediaFolder As String = "media"
Dim picname As String
Dim zipname As String
Set fso = New FileSystemObject
Set myFolder = fso.GetFolder(zipDir)
For Each objFile In myFolder.Files
zipname = objFile.Name
Next objFile
End Sub
^該代碼成功地遍歷該文件夾並收集壓縮文件的名稱。但我需要進入文件並遍歷結構才能進入媒體文件夾。
https://www.rondebruin.nl/win/ s7/win002.htm –