IconIndex Property Example

This example returns the icon index number in a message box for the first selected shape that's displayed as an icon.

If Selection.ShapeRange.Count >= 1 Then
    Set myOLEF = Selection.ShapeRange(1).OLEFormat
    With myOLEF
        If .DisplayAsIcon = True Then Msgbox .IconIndex
    End With
End If