Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WordprocessingDocument.Open Method (String, Boolean)

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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

Namespace:  DocumentFormat.OpenXml.Packaging
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

public static WordprocessingDocument Open(
	string path,
	bool readWriteMode
)

Parameters

path
Type: System.String
Specifies the path and file name of the target Package for the OpenXmlPackage.
readWriteMode
Type: System.Boolean
Specifies the ReadWrite mode. False for Read only mode.

Return Value

Type: DocumentFormat.OpenXml.Packaging.WordprocessingDocument
Returns a new instance of WordprocessingDocument.

ExceptionCondition
ArgumentNullException

Throws an exception when path is null reference.

OpenXmlPackageException

Throws an exception when the package is not valid Open XML WordprocessingDocument.

Show:
© 2014 Microsoft