IconIndex Property

Microsoft Word Visual Basic

property is True: 0 (zero) corresponds to the first icon, 1 corresponds to the second icon, and so on. If this argument is omitted, the first (default) icon is used. Read/write Long.

expression.IconIndex

expression    Required. An expression that returns an OleFormat object.

Example

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

Dim olefTemp As OLEFormat

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