Object Model Reference : Classes : S : Shape : Methods : Shape.GetBoundingBox |
Sub GetBoundingBox(x As Double, y As Double, Width As Double, Height As Double, [UseOutline As Boolean = False])
Member of Shape
The GetBoundingBox method returns the size of a shape and the position of its lower-left corner.
• |
If the UseOutline parameter is set to True, then the outline width and shape
are accounted for when calculating the bounding-box dimensions. Otherwise,
the shape is treated as if it has no outline.
|
The following VBA example creates a rectangle around each shape on the active page.
Sub Test() |
Dim s As Shape |
Dim x As Double, y As Double, w As Double, h As Double |
ActiveDocument.ReferencePoint = cdrBottomLeft |
For Each s In ActivePage.Shapes |
s.GetBoundingBox x, y, w, h |
ActiveLayer.CreateRectangle2 x, y, s.SizeWidth, s.SizeHeight |
Next s |
End Sub |
Copyright 2013 Corel Corporation. All rights reserved.