The pin methods suggested won't work if a shape is, for instance, on the
border of the page. The pin might be greater than zero, but the shape might
be "half in the blue."
You might also draw a temporary rectangle that matches the page's size and
location.
Then try the spatial relation methods, such as shape.SpatialRelation to see
which shapes are outside of the page.
General method:
1. Draw a rectangle that matches the page
2. Select all shapes and save a reference to this selection ("Sel")
3. Remove the rectangle from Sel
4. Get a selection object of shapes inside of the rectangle: SelContained =
Rect.SpatialRelation( visSpatialContainedIn, ..., ...)
5. Remove ( Sel.Select(shp, visDeselect) ) each shape in SelContained from
Sel
6. All the remaining shapes in Sel are not on the page at all.
--
Hope this helps,
Chris Roth
Visio MVP
Bradford said:
I need to determine if any shapes lay outside the bounds of the drawing
page before executing pageObj.ResizeToFitContents() so that I only resize
when the drawing is larger than the page.