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
2. In the macro settings dialog box, give this macro a name, and then click the "Create" button on the right
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
4. Copy the code and click the run button on the toolbar ▶ (right triangle)
##5. Jump out of the macro dialog box, select this macro, and click the "Run" button 6. Close the VBA editor and you can see that the pictures have all changed to the size set in the code For more technical articles related to Word, please visit theWord 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!