staicumihai
01-07-2016, 09:17 PM
Hello guys,
I want to make a macro that automatically resizes images (while preserving the height and weight ratio) when I paste them in Microsoft Word 2010.
What I have now is this:
Option Explicit
Sub desiredimension()
On Error Resume Next
Dim oShp As Shape
Dim iShp As InlineShape
Dim ShpScale As Double
With Selection
For Each iShp In .InlineShapes
With iShp
If .Type = wdInlineShapePicture Or wdInlineShapeLinkedPicture Then
.Height = 141.64
End If
End With
Next iShp
End With
End Sub
(but it doesnt do this automatically when I paste the images, I have to go and select them all and then apply the macro)
Thanks a lot for the previous responses, that helped and helps me a lot at work and have a nice day.
I want to make a macro that automatically resizes images (while preserving the height and weight ratio) when I paste them in Microsoft Word 2010.
What I have now is this:
Option Explicit
Sub desiredimension()
On Error Resume Next
Dim oShp As Shape
Dim iShp As InlineShape
Dim ShpScale As Double
With Selection
For Each iShp In .InlineShapes
With iShp
If .Type = wdInlineShapePicture Or wdInlineShapeLinkedPicture Then
.Height = 141.64
End If
End With
Next iShp
End With
End Sub
(but it doesnt do this automatically when I paste the images, I have to go and select them all and then apply the macro)
Thanks a lot for the previous responses, that helped and helps me a lot at work and have a nice day.