Previous Document Next Document

Object Model Reference : Classes : A : ActiveView : Methods : ActiveView.ToFitShapeRange


ActiveView.ToFitShapeRange

Sub ToFitShapeRange(ShapeRange As ShapeRange)

Description

Member of ActiveView

The ToFitShapeRange method changes the active view to fit an entire collection of shape objects on the current page into the application window. The ToFitShapeRange method adjusts the zoom level of the page so that the specified shapes fill the current view in the application window.

Parameter
Description
ShapeRange
Specifies the area to include in the defined active view

VBA example

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

Previous Document Next Document Back to Top

Copyright 2013 Corel Corporation. All rights reserved.