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

Selection.GetIDs Method (Visio)

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

Gets the shape IDs of the shapes in the selection.

Note This Visio object or member is available only to licensed users of Visio Professional 2013.

Syntax

expression . GetIDs( ShapeIDs() )

expression An expression that returns a Selection object.

Parameters

NameRequired/OptionalData TypeDescription
ShapeIDs()RequiredLongOut parameter. An array of shape IDs of type Long corresponding to the shapes in the selection.

Return Value

Nothing

Remarks

Microsoft Visio uses ID numbers to identify shapes, recordsets, and data rows. Shape IDs are unique only within the scope of the page they are on. After you determine these shape IDs, you can pass them to the Page.LinkShapesToDataRows method to specify exactly how the shapes in your diagram should link to data rows in the available data recordsets. Shape IDs are unique within the scope of a particular page.

To determine the shape ID for a shape that is part of a selection, use the Selection.GetIDs method.

The set of shape IDs returned is determined by the setting of the Selection.IterationMode property.

Example

The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the GetIDs method to get the IDs of shapes in a selection and print the IDs in the Immediate window. It selects all the shapes in the active window.

Public Sub GetIDs_Example() 

    Dim vsoSelection As Visio.Selection 
    Dim lngShapeIDs() As Long 
    Dim lngShapeID As Long 

    ActiveWindow.DeselectAll 
    ActiveWindow.SelectAll 

    Set vsoSelection = ActiveWindow.Selection 

    Call vsoSelection.GetIDs(lngShapeIDs) 

    For lngShapeID = LBound(lngShapeIDs) To UBound(lngShapeIDs) 
        Debug.Print lngShapeID 
    Next 

End Sub
© 2018 Microsoft