Share via


WordprocessingDocument.Open Method

Definition

Overloads

Open(String, Boolean, OpenSettings)

Creates a new instance of the WordprocessingDocument class from the specified file.

Open(Stream, Boolean, OpenSettings)

Creates a new instance of the WordprocessingDocument class from the IO stream.

Open(String, Boolean)

Creates a new instance of the WordprocessingDocument class from the specified file.

Open(Package)

Creates a new instance of the WordprocessingDocument class from the specified package.

Open(Package, OpenSettings)

Creates a new instance of the WordprocessingDocument class from the specified package.

Open(Stream, Boolean)

Creates a new instance of the WordprocessingDocument class from the IO stream.

Open(String, Boolean, OpenSettings)

Creates a new instance of the WordprocessingDocument class from the specified file.

public static DocumentFormat.OpenXml.Packaging.WordprocessingDocument Open (string path, bool isEditable, DocumentFormat.OpenXml.Packaging.OpenSettings openSettings);
static member Open : string * bool * DocumentFormat.OpenXml.Packaging.OpenSettings -> DocumentFormat.OpenXml.Packaging.WordprocessingDocument
Public Shared Function Open (path As String, isEditable As Boolean, openSettings As OpenSettings) As WordprocessingDocument

Parameters

path
String

The path and file name of the target WordprocessingDocument.

isEditable
Boolean

In ReadWrite mode. False for Read only mode.

openSettings
OpenSettings

The advanced settings for opening a document.

Returns

A new instance of WordprocessingDocument.

Exceptions

Thrown when "path" is null reference.

Thrown when the package is not valid Open XML WordprocessingDocument.

Thrown when specified to process the markup compatibility but the given target FileFormatVersion is incorrect.

Applies to

Open(Stream, Boolean, OpenSettings)

Creates a new instance of the WordprocessingDocument class from the IO stream.

public static DocumentFormat.OpenXml.Packaging.WordprocessingDocument Open (System.IO.Stream stream, bool isEditable, DocumentFormat.OpenXml.Packaging.OpenSettings openSettings);
static member Open : System.IO.Stream * bool * DocumentFormat.OpenXml.Packaging.OpenSettings -> DocumentFormat.OpenXml.Packaging.WordprocessingDocument
Public Shared Function Open (stream As Stream, isEditable As Boolean, openSettings As OpenSettings) As WordprocessingDocument

Parameters

stream
Stream

The IO stream on which to open the WordprocessingDocument.

isEditable
Boolean

In ReadWrite mode. False for Read only mode.

openSettings
OpenSettings

The advanced settings for opening a document.

Returns

A new instance of WordprocessingDocument.

Exceptions

Thrown when "stream" is null reference.

Thrown when "stream" is not opened with Read (ReadWrite) access.

Thrown when the package is not valid Open XML WordprocessingDocument.

Thrown when specified to process the markup compatibility but the given target FileFormatVersion is incorrect.

Applies to

Open(String, Boolean)

Creates a new instance of the WordprocessingDocument class from the specified file.

public static DocumentFormat.OpenXml.Packaging.WordprocessingDocument Open (string path, bool isEditable);
static member Open : string * bool -> DocumentFormat.OpenXml.Packaging.WordprocessingDocument
Public Shared Function Open (path As String, isEditable As Boolean) As WordprocessingDocument

Parameters

path
String

The path and file name of the target WordprocessingDocument.

isEditable
Boolean

In ReadWrite mode. False for Read only mode.

Returns

A new instance of WordprocessingDocument.

Exceptions

Thrown when "path" is null reference.

Thrown when the package is not valid Open XML WordprocessingDocument.

Applies to

Open(Package)

Creates a new instance of the WordprocessingDocument class from the specified package.

public static DocumentFormat.OpenXml.Packaging.WordprocessingDocument Open (System.IO.Packaging.Package package);
static member Open : System.IO.Packaging.Package -> DocumentFormat.OpenXml.Packaging.WordprocessingDocument
Public Shared Function Open (package As Package) As WordprocessingDocument

Parameters

package
Package

The specified OpenXml package.

Returns

A new instance of WordprocessingDocument.

Exceptions

Thrown when "package" is null reference.

Thrown when "package" is not opened with Read (ReadWrite) access.

Thrown when the package is not valid Open XML WordprocessingDocument.

Applies to

Open(Package, OpenSettings)

Creates a new instance of the WordprocessingDocument class from the specified package.

public static DocumentFormat.OpenXml.Packaging.WordprocessingDocument Open (System.IO.Packaging.Package package, DocumentFormat.OpenXml.Packaging.OpenSettings openSettings);
static member Open : System.IO.Packaging.Package * DocumentFormat.OpenXml.Packaging.OpenSettings -> DocumentFormat.OpenXml.Packaging.WordprocessingDocument
Public Shared Function Open (package As Package, openSettings As OpenSettings) As WordprocessingDocument

Parameters

package
Package

The specified OpenXml package

openSettings
OpenSettings

The advanced settings for opening a document.

Returns

A new instance of WordprocessingDocument.

Exceptions

Thrown when "package" is not opened with Read (ReadWrite) access.

Thrown when package is a null reference.

Thrown when the package is not a valid Open XML document.

Thrown when specified to process the markup compatibility but the given target FileFormatVersion is incorrect.

Applies to

Open(Stream, Boolean)

Creates a new instance of the WordprocessingDocument class from the IO stream.

public static DocumentFormat.OpenXml.Packaging.WordprocessingDocument Open (System.IO.Stream stream, bool isEditable);
static member Open : System.IO.Stream * bool -> DocumentFormat.OpenXml.Packaging.WordprocessingDocument
Public Shared Function Open (stream As Stream, isEditable As Boolean) As WordprocessingDocument

Parameters

stream
Stream

The IO stream on which to open the WordprocessingDocument.

isEditable
Boolean

In ReadWrite mode. False for Read only mode.

Returns

A new instance of WordprocessingDocument.

Exceptions

Thrown when "stream" is null reference.

Thrown when "stream" is not opened with Read (ReadWrite) access.

Thrown when the package is not valid Open XML WordprocessingDocument.

Applies to