OLEFormat.IconIndex Property

Word Developer Reference

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.

Visual Basic for Applications
  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