WorkbookBase.WebOptions 属性

获取 Microsoft.Office.Interop.Excel.WebOptions 集合,该集合包含工作簿级特性,在将文档保存为网页或打开网页时 Microsoft Office Excel 将使用这些特性。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel.v4.0.Utilities(在 Microsoft.Office.Tools.Excel.v4.0.Utilities.dll 中)

语法

声明
Public ReadOnly Property WebOptions As WebOptions
    Get
public WebOptions WebOptions { get; }

属性值

类型:Microsoft.Office.Interop.Excel.WebOptions
Microsoft.Office.Interop.Excel.WebOptions 集合,包含工作簿级特性,在将文档保存为网页或打开网页时 Excel 将使用这些特性。

示例

下面的代码示例使用 WebOptions 属性启用可移植网络图形 (PNG) 作为输出格式,如果 Office Web 组件尚未安装,则使用指定的网页下载 Office Web 组件,并允许在将文档保存为网页时使用长文件名。

此示例针对的是文档级自定义项。

Private Sub SetWebOptions()
    Me.WebOptions.AllowPNG = True
    Me.WebOptions.DownloadComponents = True
    Me.WebOptions.UseLongFileNames = True
End Sub
private void SetWebOptions()
{
    this.WebOptions.AllowPNG = true;
    this.WebOptions.DownloadComponents = true;
    this.WebOptions.UseLongFileNames = true;
}

.NET Framework 安全性

请参见

参考

WorkbookBase 类

Microsoft.Office.Tools.Excel 命名空间