IconIndex 属性

       

该属性返回或设置在 DisplayAsIcon 属性值为 True 时使用的图标:0(零)对应于第一个图标,1 对应于第二个图标,以此类推。如果省略该参数,则使用第一个(默认)图标。Long 类型,可读写。

expression.IconIndex

expression   必需。该表达式返回一个 OleFormat 对象。

示例

本示例在消息框中返回显示为图标的第一个选定图形的图标索引序号。

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