Sub DeleteAllPictures() Dim Pic As InlineShape For Each Pic In ActiveDocument.InlineShapes Pic.Delete Next Pic End Sub

注:此代码将删除所有嵌入式图片,但不会删除链接的图片。如果您需要删除链接的图片,请使用以下代码:

Sub DeleteAllPictures() Dim Pic As InlineShape For Each Pic In ActiveDocument.InlineShapes If Pic.Type = wdInlineShapeLinkedPicture Then Pic.Delete End If Next Pic End Sub

用VBA写一点程序删除Word中的所有图片

原文地址: https://www.cveoy.top/t/topic/4rt 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录