Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

VisioPageQueryExtensions

OfficeIMO.Visio

Namespace
OfficeIMO.Visio
Assembly
OfficeIMO.Visio
Source revision
273d35d5ba8a with working tree changes
Modifiers
static

Query and selection helpers for editing Visio pages by semantics instead of by list indexes.

Inheritance

  • object
  • VisioPageQueryExtensions

Methods

public static IReadOnlyList<VisioShape> AllShapes(VisioPage page) #

Returns all shapes on the page, including shapes nested inside groups.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> Callouts(VisioPage page) #

Returns shapes marked as OfficeIMO callouts or annotations.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ConnectedComponent(VisioPage page, VisioShape shape, bool includeStart = true) #

Returns every shape reachable from the provided shape through connectors.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Starting shape.
includeStart bool = true optional
Whether the starting shape should be included in the returned component.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioConnector> ConnectedConnectors(VisioPage page, VisioShape shape) #

Returns connectors that either start or end at the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Shape connected to or from.

Returns

IReadOnlyList<VisioConnector>
public static IReadOnlyList<VisioShape> ConnectedShapes(VisioPage page, VisioShape shape) #

Returns shapes connected to the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Shape whose neighbors should be returned.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioConnector> ConnectorsInLayer(VisioPage page, string layerName, StringComparison comparison = OrdinalIgnoreCase) #

Returns connectors assigned to a page layer.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
layerName string required
Layer name or universal name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.

Returns

IReadOnlyList<VisioConnector>
ConnectorsWithProtection 2 overloads
public static IReadOnlyList<VisioConnector> ConnectorsWithProtection(VisioPage page) #

Returns connectors that have at least one explicit protection cell.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.

Returns

IReadOnlyList<VisioConnector>
public static IReadOnlyList<VisioConnector> ConnectorsWithProtection(VisioPage page, Func<VisioProtection, bool> predicate) #

Returns connectors whose protection state matches the predicate.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
predicate System.Func<OfficeIMO.Visio.VisioProtection, bool> required
Protection predicate.

Returns

IReadOnlyList<VisioConnector>
public static IReadOnlyList<VisioShape> Containers(VisioPage page) #

Returns shapes marked as Visio-native containers.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.

Returns

IReadOnlyList<VisioShape>
public static VisioShape? FindShapeById(VisioPage page, string id) #

Finds a shape by identifier, including shapes nested inside groups.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
id string required
Shape identifier.

Returns

VisioShape?
public static IReadOnlyList<VisioConnector> IncomingConnectors(VisioPage page, VisioShape shape) #

Returns connectors that end at the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Shape connected to.

Returns

IReadOnlyList<VisioConnector>
public static IReadOnlyList<VisioConnector> OutgoingConnectors(VisioPage page, VisioShape shape) #

Returns connectors that start at the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Shape connected from.

Returns

IReadOnlyList<VisioConnector>
public static IReadOnlyList<VisioShape> PathBetween(VisioPage page, VisioShape from, VisioShape to, bool includeEndpoints = true) #

Returns the shortest shape path between two connected shapes, or an empty list when no path exists.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
from OfficeIMO.Visio.VisioShape required
Starting shape.
to OfficeIMO.Visio.VisioShape required
Target shape.
includeEndpoints bool = true optional
Whether the starting and target shapes should be included.

Returns

IReadOnlyList<VisioShape>
public static VisioShapeSelection SelectByMaster(VisioPage page, string masterNameU, StringComparison comparison = OrdinalIgnoreCase) #

Selects shapes created from a matching master universal name.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
masterNameU string required
Master universal name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.
public static VisioShapeSelection SelectByName(VisioPage page, string name, StringComparison comparison = OrdinalIgnoreCase) #

Selects shapes with a matching shape name.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
Shape name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.
public static VisioShapeSelection SelectByNameU(VisioPage page, string nameU, StringComparison comparison = OrdinalIgnoreCase) #

Selects shapes with a matching universal shape name.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
nameU string required
Universal shape name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.
public static VisioShapeSelection SelectCallouts(VisioPage page) #

Selects shapes marked as OfficeIMO callouts or annotations.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
public static VisioShapeSelection SelectConnectedComponent(VisioPage page, VisioShape shape, bool includeStart = true) #

Selects every shape reachable from the provided shape through connectors.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Starting shape.
includeStart bool = true optional
Whether the starting shape should be included in the returned component.
public static VisioConnectorSelection SelectConnectedConnectors(VisioPage page, VisioShape shape) #

Selects connectors that either start or end at the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Shape connected to or from.
public static VisioConnectorSelection SelectConnectors(VisioPage page, Func<VisioConnector, bool> predicate) #

Selects connectors matching a predicate for bulk editing.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
predicate System.Func<OfficeIMO.Visio.VisioConnector, bool> required
Predicate used to include connectors.
public static VisioConnectorSelection SelectConnectorsInLayer(VisioPage page, string layerName, StringComparison comparison = OrdinalIgnoreCase) #

Selects connectors assigned to a page layer.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
layerName string required
Layer name or universal name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.
SelectConnectorsWithProtection 2 overloads
public static VisioConnectorSelection SelectConnectorsWithProtection(VisioPage page) #

Selects connectors that have at least one explicit protection cell.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
public static VisioConnectorSelection SelectConnectorsWithProtection(VisioPage page, Func<VisioProtection, bool> predicate) #

Selects connectors whose protection state matches the predicate.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
predicate System.Func<OfficeIMO.Visio.VisioProtection, bool> required
Protection predicate.
SelectContainedIn 2 overloads
public static VisioShapeSelection SelectContainedIn(VisioPage page, VisioShapeBounds bounds) #

Selects shapes whose bounds are fully contained by the provided bounds.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
bounds OfficeIMO.Visio.VisioShapeBounds required
Containing bounds.
public static VisioShapeSelection SelectContainedIn(VisioPage page, VisioShape container, bool includeContainer = false) #

Selects shapes whose bounds are fully contained by the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
container OfficeIMO.Visio.VisioShape required
Shape whose bounds are used as the containing area.
includeContainer bool = false optional
Whether the containing shape itself should be included.
public static VisioShapeSelection SelectContainers(VisioPage page) #

Selects shapes marked as Visio-native containers.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
public static VisioShapeSelection SelectContainingText(VisioPage page, string text, StringComparison comparison = OrdinalIgnoreCase) #

Selects shapes whose text contains the provided value.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
text string required
Text fragment to find.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.
public static VisioConnectorSelection SelectIncomingConnectors(VisioPage page, VisioShape shape) #

Selects connectors that end at the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Shape connected to.
SelectIntersecting 2 overloads
public static VisioShapeSelection SelectIntersecting(VisioPage page, VisioShapeBounds bounds) #

Selects shapes whose bounds intersect the provided bounds.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
bounds OfficeIMO.Visio.VisioShapeBounds required
Bounds to test against.
public static VisioShapeSelection SelectIntersecting(VisioPage page, VisioShape shape, bool includeSelf = false) #

Selects shapes whose bounds intersect the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Shape whose bounds are used for the test.
includeSelf bool = false optional
Whether the reference shape itself should be included.
public static VisioShapeSelection SelectLayer(VisioPage page, string layerName, StringComparison comparison = OrdinalIgnoreCase) #

Selects shapes assigned to a page layer.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
layerName string required
Layer name or universal name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.
public static VisioConnectorSelection SelectOutgoingConnectors(VisioPage page, VisioShape shape) #

Selects connectors that start at the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Shape connected from.
public static VisioShapeSelection SelectPathBetween(VisioPage page, VisioShape from, VisioShape to, bool includeEndpoints = true) #

Selects the shortest shape path between two connected shapes.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
from OfficeIMO.Visio.VisioShape required
Starting shape.
to OfficeIMO.Visio.VisioShape required
Target shape.
includeEndpoints bool = true optional
Whether the starting and target shapes should be included.
public static VisioShapeSelection SelectShapes(VisioPage page, Func<VisioShape, bool> predicate) #

Selects shapes matching a predicate for bulk editing.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
predicate System.Func<OfficeIMO.Visio.VisioShape, bool> required
Predicate used to include shapes.
SelectWithData 3 overloads
public static VisioShapeSelection SelectWithData(VisioPage page, string key) #

Selects shapes that contain the provided data key.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
key string required
Data key.
public static VisioShapeSelection SelectWithData(VisioPage page, string key, string value, StringComparison comparison = OrdinalIgnoreCase) #

Selects shapes that contain the provided data key and value.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
key string required
Data key.
value string required
Data value.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.
public static VisioShapeSelection SelectWithData(VisioPage page, string key, Func<string?, bool> predicate) #

Selects shapes whose Shape Data value for the provided key matches a predicate.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
key string required
Data key.
predicate System.Func<string?, bool> required
Predicate that receives the current Shape Data value.
SelectWithProtection 2 overloads
public static VisioShapeSelection SelectWithProtection(VisioPage page) #

Selects shapes that have at least one explicit protection cell.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
public static VisioShapeSelection SelectWithProtection(VisioPage page, Func<VisioShapeProtection, bool> predicate) #

Selects shapes whose protection state matches the predicate.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
predicate System.Func<OfficeIMO.Visio.VisioShapeProtection, bool> required
Protection predicate.
SelectWithShapeData 3 overloads
public static VisioShapeSelection SelectWithShapeData(VisioPage page, string name) #

Selects shapes that contain a Visio Shape Data row.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
Shape Data row name.
public static VisioShapeSelection SelectWithShapeData(VisioPage page, string name, string value, StringComparison comparison = OrdinalIgnoreCase) #

Selects shapes with a matching Visio Shape Data value.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
Shape Data row name.
value string required
Shape Data value.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.
public static VisioShapeSelection SelectWithShapeData(VisioPage page, string name, Func<string?, bool> predicate) #

Selects shapes whose Visio Shape Data value for the provided row name matches a predicate.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
Shape Data row name.
predicate System.Func<string?, bool> required
Predicate that receives the current Shape Data value.
SelectWithUserCell 2 overloads
public static VisioShapeSelection SelectWithUserCell(VisioPage page, string name) #

Selects shapes that contain a Visio User cell.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
User cell row name.
public static VisioShapeSelection SelectWithUserCell(VisioPage page, string name, string value, StringComparison comparison = OrdinalIgnoreCase) #

Selects shapes with a matching Visio User cell value.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
User cell row name.
value string required
User cell value.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.
public static IReadOnlyList<VisioShape> ShapesByMaster(VisioPage page, string masterNameU, StringComparison comparison = OrdinalIgnoreCase) #

Returns shapes created from a matching master universal name.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
masterNameU string required
Master universal name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesByName(VisioPage page, string name, StringComparison comparison = OrdinalIgnoreCase) #

Returns shapes with a matching shape name.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
Shape name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesByNameU(VisioPage page, string nameU, StringComparison comparison = OrdinalIgnoreCase) #

Returns shapes with a matching universal shape name.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
nameU string required
Universal shape name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.

Returns

IReadOnlyList<VisioShape>
ShapesContainedIn 2 overloads
public static IReadOnlyList<VisioShape> ShapesContainedIn(VisioPage page, VisioShapeBounds bounds) #

Returns shapes whose bounds are fully contained by the provided bounds.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
bounds OfficeIMO.Visio.VisioShapeBounds required
Containing bounds.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesContainedIn(VisioPage page, VisioShape container, bool includeContainer = false) #

Returns shapes whose bounds are fully contained by the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
container OfficeIMO.Visio.VisioShape required
Shape whose bounds are used as the containing area.
includeContainer bool = false optional
Whether the containing shape itself should be included.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesContainingText(VisioPage page, string text, StringComparison comparison = OrdinalIgnoreCase) #

Returns shapes whose text contains the provided value.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
text string required
Text fragment to find.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesInLayer(VisioPage page, string layerName, StringComparison comparison = OrdinalIgnoreCase) #

Returns shapes assigned to a page layer.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
layerName string required
Layer name or universal name.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.

Returns

IReadOnlyList<VisioShape>
ShapesIntersecting 2 overloads
public static IReadOnlyList<VisioShape> ShapesIntersecting(VisioPage page, VisioShapeBounds bounds) #

Returns shapes whose bounds intersect the provided bounds.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
bounds OfficeIMO.Visio.VisioShapeBounds required
Bounds to test against.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesIntersecting(VisioPage page, VisioShape shape, bool includeSelf = false) #

Returns shapes whose bounds intersect the provided shape.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
shape OfficeIMO.Visio.VisioShape required
Shape whose bounds are used for the test.
includeSelf bool = false optional
Whether the reference shape itself should be included.

Returns

IReadOnlyList<VisioShape>
ShapesWithData 3 overloads
public static IReadOnlyList<VisioShape> ShapesWithData(VisioPage page, string key) #

Returns shapes that contain the provided data key.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
key string required
Data key.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesWithData(VisioPage page, string key, string value, StringComparison comparison = OrdinalIgnoreCase) #

Returns shapes that contain the provided data key and value.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
key string required
Data key.
value string required
Data value.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesWithData(VisioPage page, string key, Func<string?, bool> predicate) #

Returns shapes whose Shape Data value for the provided key matches a predicate.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
key string required
Data key.
predicate System.Func<string?, bool> required
Predicate that receives the current Shape Data value.

Returns

IReadOnlyList<VisioShape>
ShapesWithProtection 2 overloads
public static IReadOnlyList<VisioShape> ShapesWithProtection(VisioPage page) #

Returns shapes that have at least one explicit protection cell.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesWithProtection(VisioPage page, Func<VisioShapeProtection, bool> predicate) #

Returns shapes whose protection state matches the predicate.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
predicate System.Func<OfficeIMO.Visio.VisioShapeProtection, bool> required
Protection predicate.

Returns

IReadOnlyList<VisioShape>
ShapesWithShapeData 3 overloads
public static IReadOnlyList<VisioShape> ShapesWithShapeData(VisioPage page, string name) #

Returns shapes that contain a Visio Shape Data row.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
Shape Data row name.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesWithShapeData(VisioPage page, string name, string value, StringComparison comparison = OrdinalIgnoreCase) #

Returns shapes with a matching Visio Shape Data value.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
Shape Data row name.
value string required
Shape Data value.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesWithShapeData(VisioPage page, string name, Func<string?, bool> predicate) #

Returns shapes whose Visio Shape Data value for the provided row name matches a predicate.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
Shape Data row name.
predicate System.Func<string?, bool> required
Predicate that receives the current Shape Data value.

Returns

IReadOnlyList<VisioShape>
ShapesWithUserCell 2 overloads
public static IReadOnlyList<VisioShape> ShapesWithUserCell(VisioPage page, string name) #

Returns shapes that contain a Visio User cell.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
User cell row name.

Returns

IReadOnlyList<VisioShape>
public static IReadOnlyList<VisioShape> ShapesWithUserCell(VisioPage page, string name, string value, StringComparison comparison = OrdinalIgnoreCase) #

Returns shapes with a matching Visio User cell value.

Parameters

page OfficeIMO.Visio.VisioPage required
Page to query.
name string required
User cell row name.
value string required
User cell value.
comparison System.StringComparison = OrdinalIgnoreCase optional
String comparison used for matching.

Returns

IReadOnlyList<VisioShape>