RE: How can I to scale down or to scale up proportionally dimension of by JeanGuyMarcil
JeanGuyMarcil
Thu Jul 03 08:20:03 PDT 2008
"avkokin" wrote:
> Hello. The document has a lot of the formulas (as pictures). The
> formulas has different dimensions: very big, normal and small. I need
> to reduce they to some equal dimension (to reduce to common
> denominator). I have code but the result of work not suit for me: e.g.
> the text into the big formulas converges and other problems. Here the
If you change the size of those equations so that they all have the same
size (Height and Width), you will have distortion problems and you cannot
avoid that.
If you want, you can reduce all inline shapes by a certain ratio based on
the shape width, then you would use something like this:
Sub changeImages()
Dim iShape As InlineShape
Const sngWidth As Single = 150
For Each iShape In ActiveDocument.InlineShapes
With iShape
.ScaleHeight = (.Width / sngWidth) * 100
.ScaleWidth = (.Width / sngWidth) * 100
End With
Next iShape
End Sub
Alternatively, if you want to reduce all shapes by an absolute percentage,
let's say, 50%, try:
Sub changeImages()
Dim iShape As InlineShape
For Each iShape In ActiveDocument.InlineShapes
With iShape
.ScaleHeight = 50
.ScaleWidth = 50
End With
Next iShape
End Sub
If you want to set them all to the same size while trying to avoid
distortion, try this:
Sub changeImages()
Dim iShape As InlineShape
Const sngWidth As Single = 72 '72 points = 1 inche
For Each iShape In ActiveDocument.InlineShapes
With iShape
.Height = .Height * (sngWidth / .Width)
.Width = sngWidth
End With
Next iShape
End Sub