Share via


SpreadsheetDocument.Create 方法

定义

重载

Create(Package, SpreadsheetDocumentType)

从指定的包创建 SpreadsheetDocument 类的新实例。

Create(Stream, SpreadsheetDocumentType)

从 IO 流创建 SpreadsheetDocument 类的新实例。

Create(String, SpreadsheetDocumentType)

从指定文件创建 SpreadsheetDocument 类的新实例。

Create(Package, SpreadsheetDocumentType, Boolean)

从指定的包创建 SpreadsheetDocument 类的新实例。

Create(Stream, SpreadsheetDocumentType, Boolean)

从 IO 流创建 SpreadsheetDocument 类的新实例。

Create(String, SpreadsheetDocumentType, Boolean)

从指定文件创建 SpreadsheetDocument 类的新实例。

Create(Package, SpreadsheetDocumentType)

从指定的包创建 SpreadsheetDocument 类的新实例。

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Packaging.Package package, DocumentFormat.OpenXml.SpreadsheetDocumentType type);
static member Create : System.IO.Packaging.Package * DocumentFormat.OpenXml.SpreadsheetDocumentType -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Create (package As Package, type As SpreadsheetDocumentType) As SpreadsheetDocument

参数

package
Package

指定的 OpenXml 包。

type
SpreadsheetDocumentType

SpreadsheetDocument 的类型。

返回

SpreadsheetDocument 的新实例。

例外

当“package”为 null 引用时引发。

未使用写入权限打开“package”时引发。

适用于

Create(Stream, SpreadsheetDocumentType)

从 IO 流创建 SpreadsheetDocument 类的新实例。

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Stream stream, DocumentFormat.OpenXml.SpreadsheetDocumentType type);
static member Create : System.IO.Stream * DocumentFormat.OpenXml.SpreadsheetDocumentType -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Create (stream As Stream, type As SpreadsheetDocumentType) As SpreadsheetDocument

参数

stream
Stream

要创建 SpreadsheetDocument 的 IO 流。

type
SpreadsheetDocumentType

SpreadsheetDocument 的类型。

返回

SpreadsheetDocument 的新实例。

例外

当“stream”为 null 引用时引发。

未使用写入权限打开“stream”时引发。

适用于

Create(String, SpreadsheetDocumentType)

从指定文件创建 SpreadsheetDocument 类的新实例。

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (string path, DocumentFormat.OpenXml.SpreadsheetDocumentType type);
static member Create : string * DocumentFormat.OpenXml.SpreadsheetDocumentType -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Create (path As String, type As SpreadsheetDocumentType) As SpreadsheetDocument

参数

path
String

目标 SpreadsheetDocument 的路径和文件名。

type
SpreadsheetDocumentType

SpreadsheetDocument 的类型。

返回

SpreadsheetDocument 的新实例。

例外

当“path”为 null 引用时引发。

适用于

Create(Package, SpreadsheetDocumentType, Boolean)

从指定的包创建 SpreadsheetDocument 类的新实例。

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Packaging.Package package, DocumentFormat.OpenXml.SpreadsheetDocumentType type, bool autoSave);
static member Create : System.IO.Packaging.Package * DocumentFormat.OpenXml.SpreadsheetDocumentType * bool -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Create (package As Package, type As SpreadsheetDocumentType, autoSave As Boolean) As SpreadsheetDocument

参数

package
Package

指定的 OpenXml 包。

type
SpreadsheetDocumentType

SpreadsheetDocument 的类型。

autoSave
Boolean

是否自动保存创建的文档。

返回

SpreadsheetDocument 的新实例。

例外

当“package”为 null 引用时引发。

未使用写入权限打开“package”时引发。

适用于

Create(Stream, SpreadsheetDocumentType, Boolean)

从 IO 流创建 SpreadsheetDocument 类的新实例。

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (System.IO.Stream stream, DocumentFormat.OpenXml.SpreadsheetDocumentType type, bool autoSave);
static member Create : System.IO.Stream * DocumentFormat.OpenXml.SpreadsheetDocumentType * bool -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Create (stream As Stream, type As SpreadsheetDocumentType, autoSave As Boolean) As SpreadsheetDocument

参数

stream
Stream

要创建 SpreadsheetDocument 的 IO 流。

type
SpreadsheetDocumentType

SpreadsheetDocument 的类型。

autoSave
Boolean

是否自动保存创建的文档。

返回

SpreadsheetDocument 的新实例。

例外

当“stream”为 null 引用时引发。

未使用写入权限打开“stream”时引发。

适用于

Create(String, SpreadsheetDocumentType, Boolean)

从指定文件创建 SpreadsheetDocument 类的新实例。

public static DocumentFormat.OpenXml.Packaging.SpreadsheetDocument Create (string path, DocumentFormat.OpenXml.SpreadsheetDocumentType type, bool autoSave);
static member Create : string * DocumentFormat.OpenXml.SpreadsheetDocumentType * bool -> DocumentFormat.OpenXml.Packaging.SpreadsheetDocument
Public Shared Function Create (path As String, type As SpreadsheetDocumentType, autoSave As Boolean) As SpreadsheetDocument

参数

path
String

目标 SpreadsheetDocument 的路径和文件名。

type
SpreadsheetDocumentType

SpreadsheetDocument 的类型。

autoSave
Boolean

是否自动保存创建的文档。

返回

SpreadsheetDocument 的新实例。

例外

当“path”为 null 引用时引发。

适用于