DoVerb Method

Microsoft Word Visual Basic

Requests that an OLE object perform one of its available verbs— the actions an OLE object takes to activate its contents. Each OLE object supports a set of verbs that pertain to that object.

expression.DoVerb(VerbIndex)

expression    Required. An expression that returns an OLEFormat object.

VerbIndex    Optional Variant. The verb that the OLE object should perform. If this argument is omitted, the default verb is sent. If the OLE object does not support the requested verb, an error will occur. Can be any WdOLEVerb constant.

WdOLEVerb can be one of these WdOLEVerb constants.
wdOLEVerbPrimary Performs the verb that is invoked when the user double-clicks the object.
wdOLEVerbShow Shows the object to the user for editing or viewing. Use it to show a newly inserted object for initial editing.
wdOLEVerbOpen Opens the object in a separate window.
wdOLEVerbHide Removes the object's user interface from view.
wdOLEVerbUIActivate Activates the object in place and displays any user-interface tools that the object needs, such as menus or toolbars.
wdOLEVerbInPlaceActivateRuns the object and installs its window, but doesn't install any user-interface tools.
wdOLEVerbDiscardUndoState Forces the object to discard any undo state that it might be maintaining; note that the object remains active, however.

Example

This example sends the default verb to the server for the first floating OLE object on the active document.

ActiveDocument.Shapes(1).OLEFormat.DoVerb