Application.TableCopy 方法 (Project)Application.TableCopy Method (Project)

创建活动表的副本,将其添加到下拉列表菜单,并设置要使用新表的视图。Makes a copy of the active table, adds it to the Tables drop-down menu, and sets the view to use the new table.

语法Syntax

expressionexpression. TableCopy( _Name_ )

_表达式_一个返回Application对象的表达式。expression An expression that returns an Application object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
NameName 可选Optional StringString 所复制的表的名称。Name of the copied table.

返回值Return value

BooleanBoolean

备注Remarks

在功能区上的视图选项卡上下拉列表菜单。The Tables drop-down menu is on the View tab on the ribbon. 如果没有指定 Name参数运行 TableCopy 方法时,Project 将显示 保存表对话框。If you run the TableCopy method without specifying the Name argument, Project displays the Save Table dialog box.

注释 TableCopy操作没有存储在撤消列表中。Note The TableCopy action is not stored in the Undo list.

有关详细控制表功能副本时,请参阅**TableEditEx** 方法。For detailed control of table features when making a copy, see the TableEditEx method.

示例Example

如果活动视图是"资源工作表",则以下语句可将资源数据编辑表复制为名为"Copy of Resource Sheet table"的表,然后将"资源工作表"视图设置为使用该表。If the active view is the Resource Sheet, the following statement copies the resource Entry table to a table named "Copy of Resource Sheet table" and then sets the Resource Sheet view to use that table.

TableCopy Name:="Copy of Resource Sheet table"