Ellen
我写论文时经常要把所有的图调整成一样大小,使用的都是以下的代码,供参考。至于批量插入图片等功能,因为写论文时从来用不上,也不知道应该弄成什么样子,所以无法回答你。

Sub 一次性调整公式以外的图片大小及格式()
       \'功能 1 :把全文的图片调整成同样大小,公式除外
       \'功能 2 :如果图片不是 jpg 格式的,统一调整成 jpg 格式并居中,以减小文档体积
       \'========================
       Mywidth = 7 \'需要的图片宽度(厘米)
       Myheigth = 5 \'需要的图片高度(厘米)
       \'========================
       Dim myPic As InlineShape
   For Each myPic In ActiveDocument.InlineShapes
       With myPic
               .Select
               Select Case .Type
               Case wdInlineShapePicture
                       .Height = 28.345 * Myheigth
                       .Width = 28.345 * Mywidth
                       Selection.ParagraphFormat.Alignment =
wdAlignParagraphCenter
                                         Selection.Cut
                       Selection.PasteSpecial Link:=False,
DataType:=15, Placement:=wdInLine, DisplayAsIcon:=False
               End Select
       End With
   Next
End Sub

分类:

技术点:

相关文章:

  • 2021-12-05
  • 2021-12-05
  • 2022-12-23
  • 2021-12-06
  • 2021-12-05
  • 2021-12-23
  • 2021-12-28
猜你喜欢
  • 2021-11-28
  • 2021-12-31
  • 2022-01-01
  • 2021-09-29
  • 2021-10-30
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案