Share via


ClassID Property [Visio 2003 SDK Documentation]

As it applies to the Document object.

Returns the class ID string of the container application in which the document is embedded.

strRet = object**.ClassID**

strRet    String. The class ID of the container within which the document is embedded.

object    Required. An expression that returns the Document object to examine.

Version added

4.5

Remarks

If the class ID of the container application in which the document is embedded cannot be retrieved, the ClassID property raises an exception. If the document is not embedded in a container, the ClassID property returns an empty string.

ClassID returns a string of the form:

    {2287DC42-B167-11CE-88E9-002AFDDD917}

This string identifies the application that contains the document. It might, for example, identify the document's container as a Microsoft Excel object.

As it applies to the OLEObject and Shape objects.

Returns the class ID string of a shape that represents an ActiveX control or an embedded or linked OLE object.

strRet = object**.ClassID**

strRet    String. The class ID of the ActiveX control or OLE object represented by the shape.

object     Required. An expression that returns the Shape object to examine.

Version added

4.5

Remarks

The ClassID property raises an exception if the shape doesn't represent an ActiveX control or an OLE 2.0 embedded or linked object. A shape represents an ActiveX control or an OLE 2.0 embedded or linked object if the visTypeIsOLE2 bit (&H8000) is set in the value returned by vsoShape.ForeignType.

ClassID returns a string of the form:

{2287DC42-B167-11CE-88E9-002AFDDD917}

This identifies the application that services the object. It might, for example, identify an embedded object on a Microsoft Office Visio page as a Microsoft Office Excel object.

After using a shape's Object property to obtain an Automation interface on the object the shape represents, you might want to obtain the shape's ClassID or ProgID property to determine the methods and properties provided by the interface.

Example

As it applies to the OLEObject object.

The following Microsoft Visual Basic for Applications (VBA) macro shows how to get the OLEObjects collection of an active page and print the ClassID 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 ClassID_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 collection of OLEObjects on the page.
    For intCounter = 1 To vsoOLEObjects.Count 
        Debug.Print vsoOLEObjects(intCounter).ClassID 
    Next intCounter
 
End Sub

Applies to | Document object | OLEObject object | Shape object

See Also | ForeignType property | Object property | ProgID property