Object Model Reference : Classes : S : Shape : Properties : Shape.PositionY |
Property PositionY As Double
Member of Shape
The PositionY property returns or specifies the vertical, or y-, coordinate of a shape. The position is relative to a reference point specified by the Document.ReferencePoint property.
• |
The following VBA example moves objects, as needed, so that they are all within the current page boundaries.
Sub Test() |
Dim s As Shape |
Dim pw As Double, ph As Double |
ActivePage.GetSize pw, ph |
For Each s In ActivePage.Shapes |
If s.Type <> cdrGuidelineShape Then |
ActiveDocument.ReferencePoint = cdrBottomLeft |
If s.PositionX < 0 Then s.PositionX = 0 |
If s.PositionY < 0 Then s.PositionY = 0 |
ActiveDocument.ReferencePoint = cdrTopRight |
If s.PositionX > pw Then s.PositionX = pw |
If s.PositionY > ph Then s.PositionY = ph |
End If |
Next s |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.