Selection.DrawRegion Method (Visio)
Draws a new shape that represents the region containing a given point.
expression .DrawRegion(Tolerance, Flags, x, y, ResultsMaster)
expression A variable that represents a Selection object.
Error tolerance when determining the coincidence of points. A distance expressed in internal units in the coordinate space of the Selection object's containing shape; the maximum gap between paths that is tolerated when constructing the boundaries of a region.
A constant or integer that specifies how to draw the region.
x-coordinate in internal units in the coordinate space of the Selection object.
y-coordinate in internal units in the coordinate space of the Selection object.
The Master object which the new Shape object should be an instance of.
The DrawRegion method creates a new Shape object from pieces of the paths in the Selection object.
If both x and y are specified, the resulting shape is the smallest region that contains the point (x,y).
In the absence of either x or y, or if the point (x,y) is not contained in any region enclosed by the paths of the selected shapes, the result is the union of all the shapes that would have been created by using the Fragment operation.
If no closed region is defined by the selected shapes, the DrawRegion method returns Nothing and raises no exception.
The Flags argument can be one or a combination of the following constants declared by the Visio type library in VisDrawRegionFlags .
Delete items in selection.
Exclude visible geometry.
Include data graphic callout shapes and their sub-shapes.
Include hidden geometry.
If the DrawRegion method is passed a ResultsMaster of type VT_EMPTY or VT_ERROR (which is how VBA passes an unspecified optional argument), the new shape is not an instance of a master and the fill, line, and text styles of the new region are set to the document's default styles.
If the DrawRegion method is passed a reference to a Master object in ResultsMaster (type VT_UNKNOWN or VT_DISPATCH), the DrawRegion method instances that Master object and adds geometry computed given the Selection object.
The new Shape object has no text other than text already in ResultsMaster.