Word 文件裡有大量圖片想一次取出原始檔?最經典的是「另存為網頁」產生資料夾含所有圖片;現代版本也可直接將 .docx 改副檔名 .zip 解壓縮取出 word/media 資料夾。本文比較 4 種方法優劣。
檔案_files),裡面包含所有圖片原始檔(通常為 .png/.jpg/.gif)。




.docx 改為 .zip(需在「資料夾選項」取消「隱藏已知檔案類型副檔名」)。word\media\ 資料夾,所有內嵌圖片原始檔皆在內。優點:速度最快、保留原始解析度與格式、不經過重新壓縮。缺點:需顯示副檔名、僅限 .docx 格式。
Sub ExportPictures()
Dim i As Long, shp As InlineShape
Dim savePath As String: savePath = "C:\ExportedImages\"
If Dir(savePath, vbDirectory) = "" Then MkDir savePath
For i = 1 To ActiveDocument.InlineShapes.Count
ActiveDocument.InlineShapes(i).Select
Selection.Copy
' 需配合圖片儲存邏輯,建議用 PowerShell/外部工具
Next i
End Sub
註:VBA 直接存圖較複雜,建議改用 PowerShell:
# PowerShell 一鍵匯出
$doc = "C:\path\file.docx"
$out = "C:\ExportedImages"
Expand-Archive -Path $doc -DestinationPath "$out\_temp" -Force
Copy-Item "$out\_temp\word\media\*" $out -Recurse
Remove-Item "$out\_temp" -Recurse -Force
word\media。| 方法 | 速度 | 支援格式 | 畫質保真 | 批量處理 | 技術門檻 |
|---|---|---|---|---|---|
| 另存網頁 | 中 | .doc/.docx | 可能重壓縮 | 單檔 | 低 |
| 改 .zip 解壓 | ⚡ 最快 | .docx | ✅ 原始檔 | 單檔(可腳本批量) | 低 |
| VBA/PowerShell | 快 | .docx | ✅ 原始檔 | ✅ 批量自動化 | 中高 |
| 第三方工具 | 快 | .doc/.docx | ✅ 可選 | ✅ 批量 GUI | 低 |
image1.png),建議配合檔案重命名工具整理。