Skip to content

Latest commit

 

History

History
76 lines (43 loc) · 2.47 KB

Visio.OLEObject.ProgID.md

File metadata and controls

76 lines (43 loc) · 2.47 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
OLEObject.ProgID property (Visio)
vis_sdr.chm15214160
vis_sdr.chm15214160
Visio.OLEObject.ProgID
694ae7e0-7bde-e3a2-8b04-21eae69c135a
06/08/2017
medium

OLEObject.ProgID property (Visio)

Returns the programmatic identifier of a shape that represents an ActiveX control, an embedded object, or linked object. Read-only.

Syntax

expression. ProgID

expression A variable that represents an OLEObject object.

Return value

String

Remarks

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.

Example

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

[!includeSupport and feedback]