Coordinates of autoshape

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.
 
A

Andy Pope

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
 

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