Word
创新互联建站-专业网站定制、快速模板网站建设、高性价比灵石网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式灵石网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖灵石地区。费用合理售后完善,10年实体公司更值得信赖。宏设置图片大小
1. Alt+F8, Create 一个Macro
2. 输入Macro名,进入编辑
---按比例缩小大量图片
Sub alex() '设置图片大小
Dim n '图片个数
On Error Resume Next '忽略错误
For n = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes类型图片
picheight = ActiveDocument.InlineShapes(n).Height
picwidth = ActiveDocument.InlineShapes(n).Width
ActiveDocument.InlineShapes(n).Height = picheight * 0.5 '设置高度为0.5倍
ActiveDocument.InlineShapes(n).Width = picwidth * 0.5 '设置宽度为0.5倍
Next n
For n = 1 To ActiveDocument.Shapes.Count 'Shapes类型图片
picheight = ActiveDocument.Shapes(n).Height
picwidth = ActiveDocument.Shapes(n).Width
ActiveDocument.Shapes(n).Height = picheight * 0.5 '设置高度为0.5倍
ActiveDocument.Shapes(n).Width = picwidth * 0.5 '设置宽度为0.5倍
Next n
End Sub
---图片大小设置成绝对值 1cm=28px
Sub alex() '设置图片大小
Dim n '图片个数
On Error Resume Next '忽略错误
For n = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes类型图片
picheight = ActiveDocument.InlineShapes(n).Height
picwidth = ActiveDocument.InlineShapes(n).Width
ActiveDocument.InlineShapes(n).Height = 280 '设置高度为280px
ActiveDocument.InlineShapes(n).Width = 364 '设置宽度为364px
Next n
For n = 1 To ActiveDocument.Shapes.Count 'Shapes类型图片
picheight = ActiveDocument.Shapes(n).Height
picwidth = ActiveDocument.Shapes(n).Width
ActiveDocument.Shapes(n).Height = 280 '设置高度为280px
ActiveDocument.Shapes(n).Width = 364 '设置宽度为364px
Next n
End Sub
3. 保持,再次进入原来的word,alt-f8 run这个宏
分享标题:Word宏设置图片大小-创新互联
URL标题:
http://cdweb.net/article/coejop.html