Object Model Reference : Classes : S : ShapeRange : Methods : ShapeRange.GetBoundingBox |
Sub GetBoundingBox(x As Double, y As Double, Width As Double, Height As Double, [UseOutline As Boolean = False])
Member of ShapeRange
The GetBoundingBox method returns the position of the lower-left corner of all the objects in a shape range, treating the range as a single shape. It also returns the total size of all the shapes in the range.
• |
See also the ShapeRange.PositionX, ShapeRange.PositionY,
ShapeRange.SizeWidth, and ShapeRange.SizeHeight properties, as well as the
ShapeRange.GetPosition, ShapeRange.SetPosition, ShapeRange.GetSize,
ShapeRange.SetSize, ShapeRange.SetSizeEx, and ShapeRange.Move methods.
|
The following VBA example creates a rectangle that surrounds an ellipse.
Sub Test() |
Dim s As Shape |
Dim sr As ShapeRange |
Dim x As Double, y As Double, w As Double, h As Double |
Set s = ActiveLayer.CreateEllipse(1, 2, 3, 4) |
ActiveDocument.ReferencePoint = cdrCenter |
Set sr = ActivePage.Shapes.All |
sr.GetBoundingBox x, y, w, h |
ActiveLayer.CreateRectangle2 x, y, w, y |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.