利用VBA宏批量解决Word中图片大小、居中设置 您所在的位置:网站首页 嵌入式图片怎么调整大小 利用VBA宏批量解决Word中图片大小、居中设置

利用VBA宏批量解决Word中图片大小、居中设置

2024-06-26 07:19| 来源: 网络整理| 查看: 265

 针对office的word文档,先添加宏文件,再运行就可以。

Sub 图片格式统一() Myheigth = 8 '设置高度 Mywidth = 10 '设置宽度 On Error Resume Next For Each iShape In ActiveDocument.InlineShapes iShape.LockAspectRatio = msoFlase '取消锁定纵横比 iShape.Height = 28.345 * Myheigth iShape.Width = 28.345 * Mywidth With iShape .Range.ParagraphFormat.Reset .Range.ParagraphFormat.Alignment = wdAlignParagraphCenter '居中 End With Next For Each Shape In ActiveDocument.Shapes Shape.LockAspectRatio = msoFlase Shape.Height = 28.345 * Myheigth Shape.Width = 28.345 * Mywidth With Shape .Range.ParagraphFormat.Reset .Range.ParagraphFormat.Alignment = wdAlignParagraphCenter '居中 End With Next End Sub

 



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有