Opens and returns an existing Document from a SharePoint List Item.

public Document Open(this WordApplication wordApplication, Microsoft.SharePoint.SPListItem listItem, String fileName)
Public Function Open(ByVal wordApplication As WordApplication, ByVal listItem As Microsoft.SharePoint.SPListItem, ByVal fileName As String) As Document

The current WordApplication object which is calling Open

SharePoint List Item from which the file is being opened

Filename of the document to open from the List Item

The document that is opened from the List Item.

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 List Item from within SharePoint. To use this method, you must add a reference to SoftArtisans.OfficeWriter.WordWriter.SharePointIntegration.dll

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