T
Tom
I have a macro that resizes all images in a Word document to 75% of
their original size. I would like to make it so that the macro only
resizes images that have a certain style applied, such as
images_steps. How would I do that?
Here's the image macro for resizing.
Sub ImageShrink()
Dim PecentSize As Integer
Dim oIshp As InlineShape
Dim oshp As Shape
PercentSize = InputBox("Enter percent of full size", "Resize
Picture", 75)
For Each oIshp In ActiveDocument.InlineShapes
With oIshp
.ScaleHeight = PercentSize
.ScaleWidth = PercentSize
End With
Next oIshp
For Each oshp In ActiveDocument.Shapes
With oshp
.ScaleHeight Factor:=(PercentSize / 100), _
RelativeToOriginalSize:=msoCTrue
.ScaleWidth Factor:=(PercentSize / 100), _
RelativeToOriginalSize:=msoCTrue
End With
Next oshp
End Sub
their original size. I would like to make it so that the macro only
resizes images that have a certain style applied, such as
images_steps. How would I do that?
Here's the image macro for resizing.
Sub ImageShrink()
Dim PecentSize As Integer
Dim oIshp As InlineShape
Dim oshp As Shape
PercentSize = InputBox("Enter percent of full size", "Resize
Picture", 75)
For Each oIshp In ActiveDocument.InlineShapes
With oIshp
.ScaleHeight = PercentSize
.ScaleWidth = PercentSize
End With
Next oIshp
For Each oshp In ActiveDocument.Shapes
With oshp
.ScaleHeight Factor:=(PercentSize / 100), _
RelativeToOriginalSize:=msoCTrue
.ScaleWidth Factor:=(PercentSize / 100), _
RelativeToOriginalSize:=msoCTrue
End With
Next oshp
End Sub