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

Window.CenterViewOnShape Method (Visio)

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

Pans the Microsoft Visio drawing window to place the specified shape in the center of the view.


expression . CenterViewOnShape( SheetObject , Flags )

expression A variable that represents a Window object.


NameRequired/OptionalData TypeDescription
SheetObjectRequiredShapeThe shape to center in the view.
FlagsRequiredVisCenterViewFlagsThe centering behavior to apply.

Return Value



The Flags parameter value must be combination of one of more of the following VisCenterViewFlags constants.

visCenterViewDefault0Display the page that contains the specified shape and center the view on the shape.
visCenterViewIfOffScreen1Center the view only if the shape is currently off screen.
visCenterViewSelectShape2Also select the shape.

If the specified shape is not valid, Microsoft Visio returns an Invalid Parameter error.

© 2018 Microsoft