码迷,mamicode.com
首页 > 其他好文 > 详细

wps 批量调整图片大小 宏

时间:2014-10-29 14:38:43      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   for   sp   div   2014   log   cti   

 1 Sub 批量调整图片大小()
 2  3  批量修改图片 Macro
 4  宏由 zxz 录制,时间: 2014/10/29
 5 批量调整图片大小,避免图片太大显示不完全
 6 
 7 循环图片集合
 8 For Each iShape In ActiveDocument.InlineShapes
 9     将高宽比还原为100%
10     iShape.ScaleHeight = 100
11     iShape.ScaleWidth = 100
12     用500除图片宽度,得出一个宽度比
13     myScale = 500 / iShape.Width
14     如果得出的宽度比小于1,说明图片宽度超出500
15     If myScale < 1 Then
16         缩小图片比例,将宽度设为500,高度按比例自动变化
17         iShape.ScaleHeight = myScale * 100
18         iShape.ScaleWidth = myScale * 100
19     End If
20 Next iShape
21 
22 End Sub

 

wps 批量调整图片大小 宏

标签:style   blog   color   for   sp   div   2014   log   cti   

原文地址:http://www.cnblogs.com/mlzs/p/4059242.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!