Message-ID: <1338937254.9967.1711707773035.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9966_321556958.1711707773035" ------=_Part_9966_321556958.1711707773035 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html WordApplication

WordApplication

Description

WordApplication is the main c= lass for pure code-based Word document generation (for information about te= mplate-based workbook generation, see=20 WordTemplate ). This class is an= engine used to open, create, and write (save to disk or stream to a browse= r) Word documents. A single instance of=20 WordApplication can generate multiple documents.=20
C#
=20
 public sealed class WordApplication
=20
=20
vb.net
=20
Public NotInheritable Class WordApplication
=20
=20

Remarks

=20
= =20
=20

WordApplication is only available in WordWriter= Enterprise Edition.

=20
=20
=20

A generated document is represented by the Document class.

The WordApplication class is in the SoftArtisans.Offi= ceWriter.WordWriter namespace. The class can can be referenced as SoftArtisans.OfficeWriter.WordWriter. To minimize typing and err= ors, import the namespace to the aspx page, and reference the class as WordApplication, without the namespace prefix. If you are coding d= irectly in the .aspx page, following the Page directive, inclu= de:

If you are coding in the code-behind page (.aspx.cs or .aspx.vb), includ= e a using or Imports statement at the top of the = code behind page:

C#
=20
using SoftArtisans.OfficeWriter.WordWriter;
=20
vb.net
=20
Imports SoftArtisans.OfficeWriter.WordWriter
=20
=20

Examples

=20
C#
=20
          //--- Create an instance of the WordApplication class
          WordApplication oWordApplication =3D new WordApplication();
        
=20
vb.net
=20
          '--- Create an instance of the WordApplication class
          Dim oWordApplication As New WordApplication()
        
=20

Properties

Name

Description

AlwaysUseUnicode

Returns a boolean that represents whether or not= WordWriter will write all text using unicode. A value of false can result in smaller file sizes but text that is not part of cp1252 (Win= dows-1252) will be unreadable. This is set to true by default.= It is recommended that you should set this to false if it is = known that only characters supported by Windows-1252 are in the document, e= specially when creating large documents.

LicenseKey

Sets or returns the license key used for this in= stance of WordApplication. Th= is property is mainly used for debugging purposes. For managing your licens= e keys, please use the License Key Manager that is installed with OfficeWri= ter.

Preserve

Sets or returns a boolean that represents whethe= r or not WordWriter will preserve feature of an existing document that it d= oes not natively support. Setting this to false can result in smaller file = sizes, but features that are not natively supported by WordWriter will be s= tripped out. This is set to true by default.

Version

Returns the exact version of WordWriter. The for= mat of the version string returned is:

Methods

Name

Description

Create()

Creates and returns a new Document based on the Normal style.

Open(String)

Opens and returns an existing Document from disk.

Open(System.IO.Stream)

Opens and returns an existing Document from the specified Stream.

Open(WordTemplate)

Takes a W= ordTemplate object representing a template Word file, and opens the fil= e as a Document object.

Save(Document, String)

Writes a Docu= ment to a file.

Save(Document, System.IO.Stream)

Writes a Docu= ment to a stream in the form of a Microsoft Word document.

Save(Document, System.Web.HttpResponse, String, Boolean)

Streams a Doc= ument to an HttpResponse with the option of having it open in the user'= s web browser. The fileName specified will appear in the browser window. In= addition, the content-type to use when streaming the file is specified.

Save(Document, System.Web.HttpResponse, String, Boolean, String)=

Streams a Doc= ument to an HttpResponse with the option of having it open in the user'= s web browser. The fileName specified will appear in the browser window. In= addition, the content-type to use when streaming the file is specified.

WordApplication()

Creates a new WordApplication object

Extension Methods

Overload

Description

Open(Microsoft.SharePoint.SPDocumentLibrary, String)

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

Open(Microsoft.SharePoint.SPListItem, String)

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

Save(Document, Microsoft.SharePoint.SPDocumentLibrary, String, Boole= an)

Writes a Docu= ment to a file and saves it to a SharePoint Document Library.

Save(Document, Microsoft.SharePoint.SPListItem, String)

Writes a Docu= ment to a file and saves it to a SharePoint List Item.
------=_Part_9966_321556958.1711707773035--