WorkbookBase.CustomViews 属性

定义

获取一个 CustomViews 集合,该集合表示工作簿的所有自定义视图。

public Microsoft.Office.Interop.Excel.CustomViews CustomViews { get; }

属性值

CustomViews

CustomViews 集合,表示工作簿的所有自定义视图。

示例

下面的代码示例使用 CustomViews 属性向当前工作簿添加一个名为 "Summary" 的自定义视图,然后以编程方式显示 "自定义视图" 对话框,以演示已创建新的自定义视图。

此示例适用于文档级自定义项。

private void AddCustomView()
{
    this.CustomViews.Add("Summary", true, true);

    this.Application.Dialogs[Excel.XlBuiltInDialog.xlDialogCustomViews].Show();
}
Private Sub AddCustomView()
    Me.CustomViews.Add("Summary", True, True)
    Me.Application.Dialogs( _
        Excel.XlBuiltInDialog.xlDialogCustomViews).Show()
End Sub

适用于