IconIndex Property

Applies To

OLEFormat object.

Description

Returns or sets the icon that's used when the DisplayAsIcon 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.

Note On the Macintosh, you cannot change icons for embedded objects, and Word ignores this property.

See Also

DisplayAsIcon property, IconLabel property, IconName property, IconPath 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