Word macro sets picture size
Word macro sets picture size
1. Alt+F8, Create a Macro
two。 Enter the Macro name to enter the editor
-scale down a large number of pictures
Sub alex () 'sets the picture size
Number of Dim n 'pictures
On Error Resume Next 'ignore errors
For n = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes type picture
Picheight = ActiveDocument.InlineShapes (n) .Height
Picwidth = ActiveDocument.InlineShapes (n) .Width
ActiveDocument.InlineShapes (n) .Height = picheight * 0.5' set height to 0.5x
ActiveDocument.InlineShapes (n) .Width = picwidth * 0.5' set width to 0.5x
Next n
For n = 1 To ActiveDocument.Shapes.Count 'Shapes type picture
Picheight = ActiveDocument.Shapes (n) .Height
Picwidth = ActiveDocument.Shapes (n) .Width
ActiveDocument.Shapes (n) .Height = picheight * 0.5' set height to 0.5x
ActiveDocument.Shapes (n) .Width = picwidth * 0.5' set width to 0.5x
Next n
End Sub
-the picture size is set to the absolute value 1cm=28px
Sub alex () 'sets the picture size
Number of Dim n 'pictures
On Error Resume Next 'ignore errors
For n = 1 To ActiveDocument.InlineShapes.Count 'InlineShapes type picture
Picheight = ActiveDocument.InlineShapes (n) .Height
Picwidth = ActiveDocument.InlineShapes (n) .Width
ActiveDocument.InlineShapes (n). Height = 280' set height to 280px
ActiveDocument.InlineShapes (n) .Width = 364 'sets the width to 364px
Next n
For n = 1 To ActiveDocument.Shapes.Count 'Shapes type picture
Picheight = ActiveDocument.Shapes (n) .Height
Picwidth = ActiveDocument.Shapes (n) .Width
ActiveDocument.Shapes (n). Height = 280' set height to 280px
ActiveDocument.Shapes (n) .Width = 364 'sets the width to 364px
Next n
End Sub
3. Keep, enter the original word,alt-f8 run macro again