OLEFormat Property

Microsoft Publisher Visual Basic

object that contains OLE formatting properties for the specified shape. Applies to Shape or ShapeRange objects that represent OLE objects.

expression.OLEFormat

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

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

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