Export (0) Print
Expand All

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.

Syntax

expression.OLEFormat

expression   A variable that represents a Shape object.

Example

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
                shp.LinkFormat.Update
            End If
        End If
    Next shp
End Sub

See Also


Community Additions

ADD
Show:
© 2014 Microsoft