Previous Document Next Document
Shape.PositionX

Property PositionX As Double

Member of Shape

The PositionX property returns or sets the horizontal, or x-, coordinate of a shape. The position is relative to a reference point specified by the Document.ReferencePoint property.

See also the GetPosition, SetPosition, and Move methods.

The following code 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 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.