Table of contents
TOC
折叠目录
展开目录

BoundObjectFrame.Action 属性 (访问)BoundObjectFrame.Action Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

可以使用在 Visual Basic 中的操作属性以指定要对 OLE 对象执行的操作。读取/写入的整数You can use the Action property in Visual Basic to specify the operation to perform on an OLE object. Read/write Integer.

语法Syntax

表达式操作expression. Action

表达式_一个表示BoundObjectFrame对象的变量。_expression A variable that represents a BoundObjectFrame object.

注解Remarks

操作属性使用以下设置。The Action property uses the following settings.

常量Constant说明Description
acOLECreateEmbed(0)acOLECreateEmbed (0)创建嵌入的对象。若要使用此设置,必须首先为acOLEEmbeddedacOLEEither设置该控件的OLETypeAllowed属性。属性设置为您要创建的 OLE 对象的类型。属性可用于将现有文件用作模板。Creates an embedded object. To use this setting, you must first set the control's OLETypeAllowed property to acOLEEmbedded or acOLEEither. Set the Class property to the type of OLE object you want to create. You can use the SourceDoc property to use an existing file as a template.
acOLECreateLink(1)acOLECreateLink (1)文件的内容创建链接的 OLE 对象。若要使用此设置,首先必须设置控件的OLETypeAllowed属性。将OLETypeAllowed属性设置为acOLELinkedacOLEEither属性指定用来创建 OLE 对象的文件。您还可以设置控件的SourceItem属性 (例如,如果您要创建的对象是 Microsoft Excel 工作表中指定的行和列区域中)。通过使用此设置创建 OLE 对象时,该控件将显示图像的控件的SourceDoc属性指定的文件。如果保存 OLE 对象时,因为该控件包含的数据,但任何源数据图像保存仅链接信息,如提供对象的应用程序的名称和链接文件的名称。Creates a linked OLE object from the contents of a file. To use this setting, you must first set the control's OLETypeAllowed and SourceDoc properties. Set the OLETypeAllowed property to acOLELinked or acOLEEither. The SourceDoc property specifies the file used to create the OLE object. You can also set the control's SourceItem property (for example, to specify a row-and-column range if the object you're creating is a Microsoft Excel worksheet). When you create an OLE object by using this setting, the control displays a metafile graphic image of the file specified by the control's SourceDoc property. If you save the OLE object, only the link information, such as the name of the application that supplied the object and the name of the linked file, is saved because the control contains an image of the data but no source data.
acOLECopy(4)acOLECopy (4)将对象复制到“剪贴板”中。将 OLE 对象复制到“剪贴板”中时,所有与此对象有关的数据和链接信息也都放置到了“剪贴板”上。可以将链接和嵌入的对象都复制到“剪贴板”上。Copies the object to the Clipboard. When you copy an OLE object to the Clipboard, all the data and link information associated with the object is placed on the Clipboard as well. You can copy both linked and embedded objects onto the Clipboard.
acOLEPaste(5)acOLEPaste (5)将数据从剪贴板粘贴到控件。如果粘贴操作成功时,控件的OLEType属性设置为acOLELinkedacOLEEmbedded。如果粘贴操作不成功,则会将OLEType属性设置为acOLENonePastes data from the Clipboard to the control. If the paste operation is successful, the control's OLEType property is set to acOLELinked or acOLEEmbedded. If the paste operation isn't successful, the OLEType property is set to acOLENone.
acOLEUpdate(6)acOLEUpdate (6)从提供对象的应用程序中检索当前数据,并将该数据作为控件中的图元文件图形来显示。Retrieves the current data from the application that supplied the object and displays that data as a metafile graphic in the control.
acOLEActivate(7)acOLEActivate (7)打开操作,例如编辑 OLE 对象。若要使用此设置,您必须首先设置控件的Verb属性。Verb属性指定要在激活 OLE 对象时执行的操作。Opens an OLE object for an operation, such as editing. To use this setting, you must first set the control's Verb property. The Verb property specifies the operation to perform when the OLE object is activated.
acOLEClose(9)acOLEClose (9)关闭 OLE 对象并结束使用提供对象的应用程序的连接。此设置应用于嵌入的对象。使用此设置等效于单击对象的控制菜单上的关闭Closes an OLE object and ends the connection with the application that supplied the object. This setting applies to embedded objects only. Using this setting is equivalent to clicking Close on the object's Control menu.
acOLEDelete(10)acOLEDelete (10)删除指定的 OLE 对象并且释放关联的内存。此设置可以直接删除 OLE 对象。当窗体关闭时,或当对象更新为新的对象时,将自动删除对象。操作属性不能用于从其基础表或基础查询中删除绑定的 OLE 对象。Deletes the specified OLE object and frees the associated memory. This setting enables you to explicitly delete an OLE object. Objects are automatically deleted when a form is closed or when the object is updated to a new object. You can't use the Action property to delete a bound OLE object from its underlying table or query.
acOLEInsertObjDlg(14)acOLEInsertObjDlg (14)显示插入对象对话框。在窗体视图或数据表视图中,您将显示此对话框可以使用户创建一个新的对象,以及链接或嵌入已有对象。控件的OLETypeAllowed属性可用于确定用户可以使用此对话框中 (用常量acOLELinkedacOLEEmbeddedacOLEEither ) 创建的对象的类型。Displays the Insert Object dialog box. In Form view or Datasheet view, you display this dialog box to enable the user to create a new object or to link or embed an existing object. You can use the control's OLETypeAllowed property to determine the type of object the user can create (with the constant acOLELinked, acOLEEmbedded, or acOLEEither ) by using this dialog box.
acOLEPasteSpecialDlg(15)acOLEPasteSpecialDlg (15)选择性粘贴对话框将显示。在窗体视图或数据表视图中,您将显示此对话框可以使用户可以从剪贴板中粘贴对象。该对话框提供了一些选项,包含粘贴链接或嵌入的对象。可用于控件的OLETypeAllowed属性确定可粘贴 (用常量acOLELinkedacOLEEmbeddedacOLEEither ) 的对象的类型通过使用此对话框。Displays the Paste Special dialog box. In Form view or Datasheet view, you display this dialog box to enable the user to paste an object from the Clipboard. The dialog box provides several options, including pasting either a linked or embedded object. You can use the control's OLETypeAllowed property to determine the type of object that can be pasted (with the constant acOLELinked, acOLEEmbedded, or acOLEEither ) by using this dialog box.
acOLEFetchVerbs(17)acOLEFetchVerbs (17)更新 OLE 对象支持动作的列表。若要显示的动作列表,请使用ObjectVerbsObjectVerbsCount属性。Updates the list of verbs an OLE object supports. To display the list of verbs, use the ObjectVerbs and ObjectVerbsCount properties.

操作属性在设计视图中不可用,但是可能会读取或设置在其他视图中。The Action property isn't available in Design view but can be read or set in other views.

当控件的启用属性设置为否或其锁定属性设置为是时,则不能使用某些操作的属性设置。下表表示允许或不允许在这些情况下的设置。When a control's Enabled property is set to No or its Locked property is set to Yes, you can't use some Action property settings. The following table indicates which settings are allowed or not allowed under these conditions.

设置Setting启用 = 否Enabled = No锁定 = 是Locked = Yes
acOLECreateEmbed(0)acOLECreateEmbed (0)不允许Not allowed不允许Not allowed
acOLECreateLink(1)acOLECreateLink (1)不允许Not allowed不允许Not allowed
acOLECopy(4)acOLECopy (4)允许Allowed允许Allowed
acOLEPaste(5)acOLEPaste (5)不允许Not allowed不允许Not allowed
acOLEUpdate(6)acOLEUpdate (6)不允许Not allowed不允许Not allowed
acOLEActivate(7)acOLEActivate (7)允许Allowed允许Allowed
acOLEClose(9)acOLEClose (9)不允许Not allowed允许Allowed
acOLEDelete(10)acOLEDelete (10)不允许Not allowed不允许Not allowed
acOLEInsertObjDlg(14)acOLEInsertObjDlg (14)不允许Not allowed不允许Not allowed
acOLEPasteSpecialDlg(15)acOLEPasteSpecialDlg (15)不允许Not allowed不允许Not allowed
acOLEFetchVerbs(17)acOLEFetchVerbs (17)不允许Not allowed允许Allowed

另请参阅See also

概念Concepts

BoundObjectFrame 对象BoundObjectFrame Object

© 2018 Microsoft