Table of contents
TOC
Collapse the table of content
Expand the table of content

Viewer.ZoomToRect Method (Visio Viewer)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Zooms to display a rectanglular section, specified by the parameters, of the drawing that is open in Microsoft Visio Viewer.

Syntax

expression. ZoomToRect( Left, Top, Right, Bottom)

_expression_An expression that returns a Viewer object.

Parameters

NameRequired/OptionalData TypeDescription
LeftRequiredLongThe x-coordinate of the top left corner of the rectangle to zoom to.
TopRequiredLongThe y-coordinate of the top left corner of the rectangle to zoom to.
RightRequiredLongThe x-coordinate of the bottom right corner of the rectangle to zoom to.
BottomRequiredLongThe y-coordinate of the bottom right corner of the rectangle to zoom to.

Return Value

Nothing

Remarks

The coordinate system for the ZoomToRect method has its origin at the top left corner of the Visio Viewer window. Positive directions are to the right (x) and down (y). The units of measurement are pixels.

The ZoomToRect method, in effect, crops a rectangular section of the drawing, specified by the parameters, and then displays that section in the entire Visio Viewer window. The parameters are a set of two pairs of coordinates, the first pair specifying the upper left corner of the section, and the second pair the lower right corner.

Example

The following code zooms to display a rectangular section of the drawing that is open in Visio Viewer. The upper left corner of the displayed section corresponds to the upper left corner of the Visio Viewer window as originally displayed. The lower right corner corresponds to a point 300 pixels down and 300 pixels to the right of the upper left corner in that original display.

vsoViewer.ZoomToRect 0, 0, 300, 300
© 2018 Microsoft