ObjectVerbs Property (OLEObject Object)

       

Returns the list of verbs an object supports.

Syntax

object.ObjectVerbs(value)

The ObjectVerbs property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value A numeric expression indicating the element in the array.

Remarks

ObjectVerbs is a zero-based string array. Use this property along with the ObjectVerbsCount property to get the verbs supported by an object. These verbs are used to determine an action to perform when an object is activated with the DoVerb method. The list of verbs in the array varies from object to object and depends on the current conditions.

Each object can support its own set of verbs. The following values represent standard verbs supported by every object:

Constant Value Description
vbOLEPrimary 0 The default action for the object.
vbOLEShow -1 Activates the object for editing. If the application that created the object supports in-place activation, the object is activated within the RichTextBox control.
vbOLEOpen -2 Opens the object in a separate application window. If the application that created the object supports in-place activation, the object is activated in its own window.
vbOLEHide -3 For embedded objects, hides the application that created the object.
vbOLEUIActivate -4 If the object supports in-place activation, activates the object for in-place activation and shows any user interface tools. If the object doesn't support in-place activation, the object doesn't activate, and an error occurs.
vbOLEInPlaceActivate -5 If the user moves the focus to the embedded object, creates a window for the object and prepares the object to be edited. An error occurs if the object doesn't support activation on a single mouse click.
vbOLEDiscardUndoState -6 Used when the object is activated for editing to discard all record of changes that the object's application can undo.

Note   These verbs may not be listed in the ObjectVerbs property array.

The first verb in the ObjectVerbs array, ObjectVerbs(0), is the default verb. Unless otherwise specified, this verb activates the object.

The remaining verbs in the array can be displayed on a menu. If it's appropriate to display the default verb in a menu, the default verb has two entries in the ObjectVerbs array.

Applications that display objects typically include an Object command on the Edit menu. When the user chooses Edit Object, a menu displays the object's verbs. Use the ObjectVerbs, ObjectVerbsCount, and ObjectVerbFlags properties to create such a menu at run time.

To automatically display the verbs in the ObjectVerbs array in a pop-up menu when the user clicks an object with the right mouse button, set the AutoVerbMenu property to True.