Connections server's specification

Connections server is the utility for the connections analysis

The Utility is made as ActiveX DLL, containing the class clsConnServ. To use DLL must be attached to the macro or program.

Public attributes

CollConn - a collection of shapes connected to the given shape. Is used in tstConn.

ColFirst, ColChild - the results of scanning a diagram. Data Formats - Nod and RecGraph.

ColFirst contains collection of ribs of graph. The rib described with name of initial shape, name of target shape and name of connector.

ColChild contains the names of nodes, presented in ColFirst collection. The names corerspond with shapes in diagram.

Scol - a collection of shapes, collected by GetGraph function.

Nodes - a collection of shape's names - the nodes of graph, harvested from the diagram.

Paths - a collection of paths between two vertices of the graph.

Public Properties

sh - researched shape;

cCon - filter for link's direction: 1 - only incoming links; 2 - only outgoing links; 3 - both incoming and outgoing;

tunn - filter for links through connector's shapes: 0 - take into account only direct connected shapes; 1 - take into account shapes, linked through connectors;

Uni - loop filter: 0 - do not take into account a links to same shape; 1 - take into account such links;

Grou - parsing groups: 0 - not to disclose the group, only the connection between the groups; 1 - expand groups, considering entering the shapes, connections between components ascribe to the group; 2 - do not take into account the group communication between the components to be considered.

Part - take into account only the shapes attached to a given point (Connection points): 0 - take into account all the connections; 100 - only the first point; 101, 102 ... - etc. - other points.

Lay - layer's filter : "" - does not depend on the layers (filter disconnected); [Layer name] - take into account only the shapes associated with a given layer; the string can contain multiple names separated by commas. For example, "Connectors, Layer2,Layer3".

Mas - master's filter: "" - the filter is disabled; [Name of the master-shape] - consider only instances of a given master shapes. The string can contain many names of master-shapes, separated by commas. For example, "nod,Dynamic connector".

cIn - filter for connector's addition; in addition to forcing shapes attached to the connector, connectors may be included in the result too: 0 - do not include; 1 - only incoming connectors; 2 - only outgoing; 3 - incoming and outgoing.

Public Methods

for shape

for the page


tstConn - universal custom function for collection the attached objects.

Public Function tstConn (ByVal tar As Visio.Shape, _

ByVal cIn As Integer, _

ByVal tunn As Integer, _

ByVal Uni As Integer, _

ByVal Grou As Integer, _

ByVal Part As Integer, _

ByVal Lay As String, _

ByVal Mas As String, _

ByVal cCon As String) As Collection

The function returns a collection of shapes, satisfying the selection criteria.

Treatment parameters correspond to the public properties.

Example of a function call:

Set tstShapes = cC1.tstConn (sh, cIn, tunn, Uni, Grou, Part, Lay, Mas, cCon)


Set tstShapes = cC1.tstConn (sh, 3, 1, 1, 0, 0, "", "", 0)


GetGraph - Fetch shapes included in the tree, attached to the original shapes.

Public Sub GetGraph (ByVal tar As Visio.Shape, ByVal cCon As Integer)

The function returns a collection of shapes.


tar - the initial shape from which the tree is scanned.

cCon - link's direction: 1 - accounted for only incoming links; 2 - for only outgoing links; 3 - for incoming and outgoing links.


SelectGraph - procedure select shapes collected via GetGraph function.

Public Sub SelectGraph ()

The procedure is used for display only, and does not return the result.

The procedure uses an internal collection of shapes Scol, that completed during execution of GetGraph.


MoveGraph - procedure is used for displacement shapes, that selected via GetGraph function.

Public Sub MoveGraph ()

The procedure is used for display only, and does not return the result.

The procedure uses an internal collection of shapes Scol, that completed during execution of GetGraph.


GetTreeFromDoc - the procedure for network's description.

Public Sub GetTreeFromDoc (pg As Visio.Page)

The procedure does not return a result. The output data are entered into two collections: ColFirst, ColChild. Output dataare used vis CreatePaths and LostLink procedures and can be used by other application.

The procedure looks at all the OneD shapes on given page (the edges of the graph), and stores the names of related nodes (NameID) in ColChild collection. Procedure inspects only the connectors are connected at both ends.

The ColFirst collection is filled with objects of type nLink, containing for each link three names: source shape, target shape, connector.


CreatePaths - finds all paths between two nodes of the graph.

Public Function CreatePaths (ByVal nam1 As String, ByVal nam2 As String) As Integer

The function returns the number of paths found between nodes nam1 and nam2.

nam1 - starting node. Given as NameID shapes.

nam2 - end node. Given as NameID shapes.

Detected paths are available in the Paths collection. Each path is a collection of indexes that can be converted into a sequence of shape's names through a Nodes collection. Nodes collection is a copy of ColChild collection, created by GetTreeFromDoc.

NameID = clsConnServ.Nodes (ind),

where ind = Item (j) - a collection of indexes,

where Item = clsConnServ.Paths (k) - way.


LostConn - search broken connections.

Public Sub LostConn (pg As Visio.Page, Optional nm As String)

The procedure does not return a result. The output data is written to the CollConn collection. The collection items are the objects nLink.


Distribution utility comes as a file Links_setup.exe. To install the utility, run this file. During the installation file links.dll placed in the System32 folder and recorded.

The procedure for connecting to the application (macro)

To use the utility in the custom macros, VBA project must have a reference to it. Link is established via the menu Tools / References. You must select in the Available References list line Links and click OK. After that, clsConnServ class and its properties and methods will be available to the macros.


The utility should work with Visio 2007, 2010, 2013.

Utility code is not signed, so there may be a security warning.

Installation in Windows 7 should be carried out as an administrator.

Version history

Will be filled as you make changes, and new releases.

Start version: v1.1.5.