This documentation is archived and is not being maintained.

Shape.OLEFormat Property

Office 2007
Returns an OLEFormat object that contains OLE formatting properties for the specified shape. Applies to Shape or ShapeRange objects that represent OLE objects.



expression   A variable that represents a Shape object.


This example loops through all the shapes on the first page of the active document and automatically updates all linked Excel worksheets.

Visual Basic for Applications
Sub UpdateLinkedExcelSpreadsheets()
    Dim shp As Shape
    For Each shp In ActiveDocument.Pages(1).Shapes
        If shp.Type = msoLinkedOLEObject Then
            If shp.OLEFormat.ProgId = "Excel.Sheet" Then
            End If
        End If
    Next shp
End Sub

See Also