Shape.ProgID Property (Visio)
Published: July 16, 2012
Returns the programmatic identifier of a shape that represents an ActiveX control, an embedded object, or linked object. Read-only.
The ProgID property raises an exception if the shape doesn't represent an ActiveX control or OLE 2.0 embedded or linked object. A shape represents an ActiveX control, embedded object, or linked object if the ForeignType property returns visTypeIsOLE2 in the value.
Use the ProgID property of a Shape object or OLEObject to obtain the programmatic identifier of the object. Every OLE object class stores a programmatic identifier for itself in the registry. Typically this occurs when the program that services the object installs itself. Client programs use this identifier to identify the object. You are using the Microsoft Visio identifier when you execute a statement such as GetObject(,"Visio.Application") from a Microsoft Visual Basic program.
These are strings that the ProgID property might return:
Visio.Drawing.5 MSGraph.Chart.5 Forms.CommandButton.1
After using a shape's Object property to obtain an IDispatch interface on the object the shape represents, you can obtain the shape's ClassID or ProgID property to determine the methods and properties provided by that interface.
This Microsoft Visual Basic for Applications (VBA) macro shows how to get the OLEObjects collection of an active page and print the ProgID for each OLEObject object in the Immediate window. This example assumes that the active page has at least one OLE 2.0 embedded or linked object or an ActiveX control.
Public Sub ProgID_Example() Dim intCounter As Integer Dim vsoOLEObjects As Visio.OLEObjects 'Get the OLEObjects collection of the active page. Set vsoOLEObjects = ActivePage.OLEObjects 'Step through the OLEObjects collection. For intCounter = 1 To vsoOLEObjects.Count Debug.Print vsoOLEObjects(intCounter).ProgID Next intCounter End Sub