Coordinates of autoshape

  • Thread starter Thread starter Gil_H
  • Start date Start date
G

Gil_H

Hi EV1,
i'm making a mcro that turns an autoshape to a polygon.
For that i'll need to know how do i get coordinates and measurements of
a shape given.
One example is Parallelogram, where you can edit it's Width. My
question is which property holds information on the Parallelogram
Width?

Thanx,
Gil H.
 
Hi,

If a understand your question you want the opposite of turning a
freeform in to a shape .ConvertToShape

The Width property of the autoshape is actually that of the bounding box
and not the shapes width. I think you will need to calculate these
dimensions yourself for a parallelogram the following will work.

'------------------
Sub X()
Dim sngWidth As Single
Dim sngCalcWidth As Single
Dim sngAdjustment As Single

With ActivePresentation.Slides(1)
With .Shapes(3) ' Parallelogram
sngWidth = .Width ' bounding width
' this adjustment is the position of the yellow handle
' that controls the slope of the shape
' drag full left returns 0 and the shape is a rectangle
' drag full right returns 1 and the shape is a diagonal line
sngAdjustment = .Adjustments(1)
End With

' subtract top left gap from bounding width
sngCalcWidth = sngWidth - (sngWidth * sngAdjustment)
End With
End Sub
'-------------------

Other shapes may not be so easy ;)

Cheers
Andy
 
Back
Top