Class OLEFormat (PowerPoint VBA)

Contains properties and methods that apply to OLE objects.

Set

To use a OLEFormat class variable it first needs to be instantiated, for example

Dim ole as OLEFormat
Set ole = ActiveWindow.RangeFromPoint.OLEFormat

The following procedures can be used to set variables of type OLEFormat: Shape.OLEFormat and ShapeRange.OLEFormat

Activate

Activates the specified object.

ActiveWindow.RangeFromPoint.OLEFormat.Activate

DoVerb

Requests that an OLE object perform one of its verbs.

Use the ObjectVerbs property to determine the available verbs for an OLE object.

Syntax : expression.DoVerb (Index)

Index: The verb to perform. If this argument is omitted, the default verb is performed.

With ActivePresentation.Slides(1).Shapes(3)
    If .Type = msoEmbeddedOLEObject Or _
            .Type = msoLinkedOLEObject Then
        .OLEFormat.DoVerb
    End If
End With

FollowColors

Returns or sets the extent to which the colors in the specified object follow the slide's color scheme.

Possible Values are ppFollowColorsMixed - The chart colors follow a mixed format of the slide's color scheme, ppFollowColorsNone - The chart colors do not follow the slide's color scheme, ppFollowColorsScheme - All the colors in the chart follow the slide's color scheme, ppFollowColorsTextAndBackground - Only the text and background follow the slide's color scheme.

The specified object must be a chart created in either Graph or Microsoft Organization Chart. The value of the FollowColors property can be one of these PpFollowColors constants.

ActivePresentation.Slides(1).Shapes(1).OLEFormat.FollowColors = ppFollowColorsMixed

Object

Returns the object that represents the specified OLE object's top-level interface. Read-only.

This property allows you to access the properties and methods of the application in which an OLE object was created. Use the TypeName function to determine the type of object this property returns for a specific OLE object.

Dim objObject As Object
Set objObject = ActivePresentation.Slides(1).Shapes(1).OLEFormat.Object

ObjectVerbs

Returns a ObjectVerbs collection that contains all the OLE verbs for the specified OLE object.

Dim ovsObjectVerbs As ObjectVerbs
Set ovsObjectVerbs = ActivePresentation.Slides(1).Shapes(1).OLEFormat.ObjectVerbs

Parent

Returns the parent object for the specified object.

ProgID

Returns the programmatic identifier (ProgID) for the specified OLE object.

Dim strProgID As String
strProgID = ActivePresentation.Slides(1).Shapes(1).OLEFormat.ProgID