Share via


OLEFormat.DoVerb Method

PowerPoint Developer Reference

Requests that an OLE object perform one of its verbs.

Syntax

expression.DoVerb(Index)

expression   A variable that represents an OLEFormat object.

Parameters

Name Required/Optional Data Type Description
Index Optional Integer The verb to perform. If this argument is omitted, the default verb is performed.

Remarks

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

Example

This example performs the default verb for shape three on slide one in the active presentation if shape three is a linked or embedded OLE object.

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

This example performs the verb "Open" for shape three on slide one in the active presentation if shape three is an OLE object that supports the verb "Open."

Visual Basic for Applications
  With ActivePresentation.Slides(1).Shapes(3)
    If .Type = msoEmbeddedOLEObject Or _
            .Type = msoLinkedOLEObject Then
        For Each sVerb In .OLEFormat.ObjectVerbs
            nCount = nCount + 1
            If sVerb = "Open" Then
                .OLEFormat.DoVerb nCount
                Exit For
            End If
        Next
    End If
End With

See Also