This tutorial will show you how to resize only the selected images in your document.
Let’s start!
- First open your document in which you have pictures that needs to be batch resized.
- Make a selection over several images. You have to select the images like you select the letters and words. Because the images are in form of Inline shapes.
- Now press “Alt+ F11” to open VBA editor in Word or you can go to developer menu and Click Visual Basic.
- Next click on “Normal” and click “Insert” tab in the main menu.
- Then choose and select “Module”.
- Open the new module by double clicking on it.
- Then on the editing space on the right, paste the following codes:
Sub ResizeImagesInSelection()
'Support-"ThinkeasyTV"-by-subscribing-our-YT-channel
Dim objInlineShape As InlineShape
Dim objShape As Shape
Dim strDegree As String
Application.ScreenUpdating = False
strheight = InputBox("Enter Height in Inches: ")
strwidth = InputBox("Enter Width in Inches: ")
Set objDoc = ActiveDocument
objShape.LockAspectRatio = False
objShape.Height = InchesToPoints(strheight)
objShape.Width = InchesToPoints(strwidth)
Set objInlineShape = objShape.ConvertToInlineShape
Next objInlineShape
End Sub
- Next click on “Run”.
- There will be an input dialog box where you can enter a height and width of images in Inches and click “OK” to proceed.
- (If you want the units in centimeters, change the part of code from Inches to Centimeters)
- Then you will only have images in selection resized to your input height width ratio.
0 Comments