OLEFormat.IconIndex property (Word)

Returns or sets the icon that is used when the DisplayAsIcon property is True. Read/write Long.

Syntax

expression. IconIndex

expression An expression that returns an 'OLEFormat' object.

Remarks

Zero (0) 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.

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

See also

OLEFormat Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.