word如何设置图片大小一样的
时间:2022-09-11 15:33:23
批量将图片调整到大小一致,PS也不是很好操作的。word文档却能很轻易的做到这一点,对于常用word的朋友就再熟悉不过了,下面让小编为你带来如何设置word图片大小一致的方法。
word设置图片大小一致的方法
1、打开word,工具-宏-宏(或者直接按Alt+F8)进入宏的界面,如下面所示,输入一个宏名,宏名自己起,能记住就行!
2、宏名起好了,单击“创建”进入Visual Basic 编辑器,输入如下代码并保存
Sub setpicsize() '设置图片大小
Dim n '图片个数
On Error Resume Next '忽略错误
For n = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes类型图片
ActiveDocument.InlineShapes(n).Height = 400 '设置图片高度为 400px
ActiveDocument.InlineShapes(n).Width = 300 '设置图片宽度 300px
Next n
For n = 1 To ActiveDocument.Shapes.Count 'Shapes类型图片
ActiveDocument.Shapes(n).Height = 400 '设置图片高度为 400px
ActiveDocument.Shapes(n).Width = 300 '设置图片宽度 300px
Next n
End Sub
3、返回word,工具-宏-宏(或者直接按Alt+F8),再次进入宏的界面,选择刚才编辑好的宏,并单击“运行”按钮,就可以了!(图片多时,可能会花一些时间)
word批量修改图片大小——按比例缩放篇
这部分要说的是把word中的所有图片按比例缩放!
具体操作同上,只是代码部分稍做修改,代码如下:
Sub setpicsize() '设置图片大小
Dim n '图片个数
Dim picwidth
Dim picheight
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 * 1.1 '设置高度为1.1倍
ActiveDocument.InlineShapes(n).Width = picwidth * 1.1 '设置宽度为1.1倍
Next n
For n = 1 ToActiveDocument.Shapes.Count 'Shapes类型图片
picheight = ActiveDocument.Shapes(n).Height
picwidth = ActiveDocument.Shapes(n).Width
ActiveDocument.Shapes(n).Height = picheight * 1.1 '设置高度为1.1倍
ActiveDocument.Shapes(n).Width = picwidth * 1.1 '设置宽度为1.1倍
Next n
End Sub
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Win10关闭了自动锁屏没有反应怎么办?
![](https://img.aspxhome.com/file/2023/8/51328_0s.jpg)
word中如何插入多个自选图形
![](https://img.aspxhome.com/file/2023/2/18112_0s.png)
Win10专业版搜索已安装补丁教程
![](https://img.aspxhome.com/file/2023/9/50049_0s.jpg)
win10系统怎么设置静态ip地址
![](https://img.aspxhome.com/file/2023/4/46514_0s.jpg)
word2007向文本框添加填充或效果
![](https://img.aspxhome.com/file/2023/0/19780_0s.jpg)
这六个Word中超实用的操作技巧,助你称霸办公室,赶紧get起来!
![](https://img.aspxhome.com/file/2023/8/17178_0s.gif)
什么是"同步化"Word2007中如何实现多个图形"同步化"
![](https://img.aspxhome.com/file/2023/5/21215_0s.jpg)
Word中VBA编辑器怎么修改代码默认的格式?
![](https://img.aspxhome.com/file/2023/9/22689_0s.jpg)
设置Word表格的VBA代码
Word中2003版文档设置密码的操作技巧
word怎么设置自动滚动页面呢?
![](https://img.aspxhome.com/file/2023/5/24025_0s.jpg)
win10系统检测错误0x00000154怎么办?win10系统检测错误0x00000154解决教程
![](https://img.aspxhome.com/file/2023/5/48465_0s.jpg)
Word2007制作倒写的"福"字
![](https://img.aspxhome.com/file/2023/2/22182_0s.jpg)
Win10系统禁用光驱的方法
![](https://img.aspxhome.com/file/2023/7/46947_0s.png)
在word2010中转换文件格式的技巧
![](https://img.aspxhome.com/file/2023/2/25042_0s.jpg)
怎么清除文字粘贴到Word时带有的一些格式
![](https://img.aspxhome.com/file/2023/2/20522_0s.jpg)
word文档backspace键为何不能向上换行?
Word文档如何进行保护
Office显示:无法保存或检查所做修改因为缓存的凭据已到期请重新登录怎么办?
![](https://img.aspxhome.com/file/2023/0/15980_0s.png)
Word批注框文字很小看是不全该怎么办?
![](https://img.aspxhome.com/file/2023/1/22891_0s.png)