ObjectFrame.ObjectVerbsCount 属性 (Access)

使用 Visual Basic 中的 ObjectVerbsCount 属性确定 OLE 对象支持的谓词数。 只读 Long

语法

表达式ObjectVerbsCount

表达 一个代表 ObjectFrame 对象的变量。

备注

ObjectVerbsCount 属性设置为指定 ObjectVerbs 属性数组中的元素数的值。

此属性设置在设计视图中不可用。

OLE 对象支持的动词列表可能有所不同,具体取决于对象的状态。 要更新所支持的动作列表,请将控件的 操作 属性设置为 acOLEFetchVerbs

示例

下面的示例将返回 OLE1 控件中的 OLE 对象所支持的动作,并在消息框中显示每个动作。

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

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。