OLEFormat.DisplayAsIcon Property

Word Developer Reference

True if the specified object is displayed as an icon. Read/write Boolean.

Syntax

expression.DisplayAsIcon

expression   A variable that represents a OLEFormat object.

Example

This example displays a message box containing the name of each floating shape that's displayed as an icon on the active document.

Visual Basic for Applications
  Dim shapeLoop As Shape

For Each shapeLoop In ActiveDocument.Shapes If shapeLoop.OLEFormat.DisplayAsIcon Then MsgBox shapeLoop.Name & " is displayed as an icon." End If Next shapeLoop

This example inserts a Microsoft Excel worksheet as a linked OLE object on the active document and then changes the display of the object to an icon.

Visual Basic for Applications
  Dim objNew As Object

Set objNew = ActiveDocument.Shapes.AddOLEObject _ (FileName:="C:\Program Files\Microsoft Office" _ & "\Office\Samples\samples.xls", LinkToFile:=True)

objNew.OLEFormat.DisplayAsIcon = True

See Also