以下是 Word 文档中批量选中图片的 VBA 宏代码:

Sub SelectAllPictures()
  Dim oShape As Shape
  For Each oShape In ActiveDocument.Shapes
    If oShape.Type = msoPicture Then
      oShape.Select msoTrue
    End If
  Next
End Sub

您可以在 Word 中打开 "开发工具",然后在 "模块" 窗口中粘贴并运行上面的代码。代码将选择文档中的所有图片。

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐