Shape ScaleHeigth, ScaleWidth

S

Scott

I'm using a macro in Word 2003. I want to know if you can get (not set) the
ScaleHeigth and ScaleWidth in Shape?

Scott
 
M

macropod

Hi Scott,

You can't read the ScaleHeigth and ScaleWidth values, but you can retrieve them with code like:

Sub GetShapeScales()
Dim oShp As Shape
Dim sHeight As Single
Dim sWidth As Single
Dim ScaleHeight As Single
Dim ScaleWidth As Single
Application.ScreenUpdating = False
For Each oShp In ActiveDocument.Shapes
With oShp
sHeight = .Height
sWidth = .Width
.ScaleHeight 1, True
.ScaleWidth 1, True
ScaleHeight = sHeight / .Height
ScaleWidth = sWidth / .Width
.ScaleHeight ScaleHeight, True
.ScaleWidth ScaleWidth, True
MsgBox "Shape: " & .Name & vbCrLf & _
"ScaleHeight: " & Format(ScaleHeight, "0.0%") & vbCrLf _
& "ScaleWidth: " & Format(ScaleWidth, "0.0%")
End With
Next oShp
Application.ScreenUpdating = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top