Advertisement
Guest User

BatchResizeAllPictures

a guest
Feb 12th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub BatchResizeAllPictures()
  2.     Dim nPercentSize As Integer
  3.     Dim objInlineShape As InlineShape
  4.     Dim objShape As Shape
  5.  
  6.     'Enter the percent whcih you want to resize picture to
  7.    nPercentSize = InputBox("Specify the percent of full size", "Resize Picture", 50)
  8.  
  9.     'Resize all the pictures in this document
  10.    For Each objInlineShape In ActiveDocument.InlineShapes
  11.         objInlineShape.ScaleHeight = nPercentSize
  12.         objInlineShape.ScaleWidth = nPercentSize
  13.     Next
  14.  
  15.     For Each objShape In ActiveDocument.Shapes
  16.         objShape.ScaleHeight PercentSize / 100, msoCTrue
  17.         objShape.ScaleWidth PercentSize / 100, msoCTrue
  18.     Next
  19. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement