Home >Topics >word >How to batch resize word pictures

How to batch resize word pictures

尚
Original
2019-06-22 14:49:4611921browse

How to batch resize word pictures

When we use Word to edit, we will insert a large number of picture files. Of course, the sizes of these pictures are generally inconsistent. Usually they need to be adjusted manually after being inserted into the document. If these pictures need to be adjusted Uniform size, how to understand batch resizing?

1. Open the document with the picture inserted, click to switch to the "View" tab, click "Macros" - View Macros

How to batch resize word pictures

2. In the macro settings dialog box, give this macro a name, and then click the "Create" button on the right

How to batch resize word pictures

3. Open the VBA editor and paste the found code to replace the default code:

Sub SetPicSize() '设置图片大小
Dim n '图片个数
On Error Resume Next '忽略错误
For n = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes 类型 图片
ActiveDocument.InlineShapes(n).Height = 24 * 28.35 '设置图片高度为 24cm (1cm等于28.35px)
ActiveDocument.InlineShapes(n).Width = 14 * 28.35 '设置图片宽度 14cm
Next n
End Sub

How to batch resize word pictures

4. Copy the code and click the run button on the toolbar ▶ (right triangle)

How to batch resize word pictures

##5. Jump out of the macro dialog box, select this macro, and click the "Run" button

How to batch resize word pictures

6. Close the VBA editor and you can see that the pictures have all changed to the size set in the code

How to batch resize word pictures

For more technical articles related to Word, please visit the

Word Tutorial column to learn!

The above is the detailed content of How to batch resize word pictures. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn