Opens and returns an existing Document from a SharePoint Document Library.

<p>public Document Open(this WordApplication wordApplication, Microsoft.SharePoint.SPDocumentLibrary docLib, String fileName)</p>
<p>Public Function Open(ByVal wordApplication As WordApplication, ByVal docLib As Microsoft.SharePoint.SPDocumentLibrary, ByVal fileName As String) As Document</p>

The current WordApplication object which is calling Open

SharePoint Document Library from which the file is being opened

Filename of the document to open from the Document Library

The document that is opened from the Document Library.

Thrown if an error occurs while opening the document.

Though the WordTemplate object currently supports Office Open XML (Word 2007) format files, WordApplication.Open() does not yet support them.

This is an extension method for the WordApplication object to be used for opening documents from a SharePoint Document Library from within SharePoint. To use this method, you must add a reference to SoftArtisans.OfficeWriter.WordWriter.SharePointIntegration.dll

Document doc = app.Open(myDocLib, "sample.doc");
Dim doc As Document = app.Open(myDocLib, "sample.doc")