ObjectVerbs Property
Applies To
ActiveX control, Bound Object Frame control, Chart control, Unbound Object Frame control.
Description
You can use the ObjectVerbs property in Visual Basic to determine the list of verbs an OLE object supports.
Setting
The ObjectVerbs property setting is a zero-based string array.
This property setting isn't available in Design view and is read-only in other views.
Remarks
You can use the ObjectVerbs property with the ObjectVerbsCount property to display a list of the verbs supported by an OLE object. The Verb property uses this list of verbs to determine which operation to perform when an OLE object is activated (when the Action property is set to acOLEActivate).
The Verb property setting is the position of a particular verb in the list of verbs returned by the ObjectVerbs property. For example, 1 specifies the first verb in the list (the Visual Basic command ObjectVerbs(0), or the first verb in the ObjectVerbs property array), 2 specifies the second verb in the list (the Visual Basic command ObjectVerbs(1), or the second verb in the ObjectVerbs property array), and so on.
The first verb in the ObjectVerbs property array, called by the Visual Basic command ObjectVerbs(0), is the default verb. If the Verb property hasn't been set, this verb specifies the operation performed when the OLE object is activated.
Applications that expose OLE objects typically include the Object command on the Edit menu. When the user points to the Object command, a submenu displays the object's verbs. You can use the ObjectVerbs and ObjectVerbsCount properties to display a list of verbs in a form or report instead of on a menu.
The list of verbs an object supports varies, depending on the state of the object. To update the list of verbs an object supports, set the control's Action property to acOLEFetchVerbs. Be sure to update the list of verbs before presenting it to the user.
See Also
Action property, ObjectVerbsCount property, Verb property.
Example
The following example returns the verbs supported by the OLE object in the OLE1 control and displays each verb in a message box.
Sub GetVerbList(frm As Form, OLE1 As Control)
Dim intX As Integer, intNumVerbs As Integer
Dim strVerbList As String
' Update verb list.
With frm!OLE1
.Action = acOLEFetchVerbs
intNumVerbs = .ObjectVerbsCount
For intX = 0 To intNumVerbs - 1
strVerbList = strVerbList & .ObjectVerbs(intX) & "; "
Next intX
End With
' Display verbs in message box.
MsgBox Left(strVerbList, Len(strVerbList) - 2)
End Sub