Table of contents
TOC
Collapse the table of content
Expand the table of content

OLEFormat.DoVerb Method (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Requests that an OLE object perform one of its verbs.

Syntax

expression. DoVerb( iVerb)

_expression_A variable that represents an OLEFormat object.

Parameters

NameRequired/OptionalData TypeDescription
iVerbRequiredLongThe verb to perform.

Remarks

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

Example

This example performs the first verb for the third shape on the first page of the active publication if the shape is a linked or embedded OLE object.

With ActiveDocument.Pages(1).Shapes(3) 
 If .Type = pbEmbeddedOLEObject Or _ 
 .Type = pbLinkedOLEObject Then 
 .OLEFormat.DoVerb (1) 
 End If 
End With

This example performs the verb "Open" for the third shape on the first page of the active publication if the shape is an OLE object that supports the verb "Open."

Dim strVerb As String 
Dim intVerb As Integer 

With ActiveDocument.Pages(1).Shapes(3) 

 ' Verify that the shape is an OLE object. 
 If .Type = pbEmbeddedOLEObject Or _ 
 .Type = pbLinkedOLEObject Then 

 ' Loop through the ObjectVerbs collection 
 ' until the "Open" verb is found. 
 For Each strVerb In .OLEFormat.ObjectVerbs 
 intVerb = intVerb + 1 
 If strVerb = "Open" Then 

 ' Perform the "Open" verb. 
 .OLEFormat.DoVerb iVerb:=intVerb 
 Exit For 
 End If 
 Next strVerb 
 End If 
End With 
© 2018 Microsoft