Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Introducedin
4.1.0.1379
4.1.0.1379
Description

Excerpt

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

Signature
C#
C#
public Document Open(this WordApplication wordApplication, Microsoft.SharePoint.SPListItem listItem, String fileName)
Signature
vb.net
vb.net
Public Function Open(ByVal wordApplication As WordApplication, ByVal listItem As Microsoft.SharePoint.SPListItem, ByVal fileName As String) As Document
Parameters
Param
wordApplication
wordApplication

The current WordApplication object which is calling Open

Param
listItem
listItem

SharePoint List Item from which the file is being opened

Param
fileName
fileName

Filename of the document to open from the List Item

Returns

The document that is opened from the List Item.

Exceptions
Exception
System.Exception
System.Exception

Thrown if an error occurs while opening the document.

Remarks

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

Note

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

Example
Code Block
csharp
csharp
titleC#
Document doc = app.Open(myListItem, "sample.doc");
Code Block
vb.net
vb.net
titlevb.net
Dim doc As Document = app.Open(myListItem, "sample.doc")