Examples:
The following VBA example creates a rectangle and circle on the current page, adds the rectangle and the circle to a shape range, and uses the ToFitShapeRange method to adjust the active view and zoom in so that the shapes in the shape range make up the entire view in CorelDRAW.
Sub ToFitShapeRange()
Dim s As Shape
Dim sr As New ShapeRange
Set s = ActiveLayer.CreateEllipse2(5, 5, 2)
sr.Add s 'Creates an ellipse and includes it in the defined range
Set s = ActiveLayer.CreateRectangle(0, 0, 2, 2)
sr.Add s 'Creates a rectangle and includes it in the defined range
ActiveWindow.ActiveView.ToFitShapeRange sr
End Sub