THEO
@theolin
Wed, Jun 25, 2025 12:57 AM
Wed, Jun 25, 2025 12:58 AM
1
1
我只能拿AI來幹這類小事
---
以下是 改良版的 VBA 巨集,會徹底刪除:
所有 內嵌圖片 (InlineShapes)
所有 浮動圖片 (Shapes)
所有圖形物件(包含圖片框、圖表、SmartArt、文字方塊等)
THEO
@theolin
Wed, Jun 25, 2025 12:57 AM
Sub RemoveAllPicturesAndShapes()
Dim iShp As InlineShape
Dim shp As Shape
Dim i As Integer
THEO
@theolin
Wed, Jun 25, 2025 12:57 AM
' 移除所有 InlineShapes(含圖片、圖表等)
For i = ActiveDocument.InlineShapes.Count To 1 Step -1
ActiveDocument.InlineShapes(i).Delete
Next i
' 移除所有浮動 Shapes(圖片、文字框、SmartArt 等)
For i = ActiveDocument.Shapes.Count To 1 Step -1
ActiveDocument.Shapes(i).Delete
Next i
MsgBox "已移除所有圖片與圖形框。", vbInformation
End Sub
載入新的回覆
---
以下是 改良版的 VBA 巨集,會徹底刪除:
所有 內嵌圖片 (InlineShapes)
所有 浮動圖片 (Shapes)
所有圖形物件(包含圖片框、圖表、SmartArt、文字方塊等)
Dim iShp As InlineShape
Dim shp As Shape
Dim i As Integer
For i = ActiveDocument.InlineShapes.Count To 1 Step -1
ActiveDocument.InlineShapes(i).Delete
Next i
' 移除所有浮動 Shapes(圖片、文字框、SmartArt 等)
For i = ActiveDocument.Shapes.Count To 1 Step -1
ActiveDocument.Shapes(i).Delete
Next i
MsgBox "已移除所有圖片與圖形框。", vbInformation
End Sub