ASP.NET Reference: WordTemplate Object Open SetCultureInfo SetDataSource GetVersion Process Save
ASP Reference: WordTemplate Object Open SetCultureInfo SetDataSource GetVersion Process Save

ASP.NET Programmer's Reference

The WordTemplate Object


The WordTemplate object represents a WordWriter template. A WordWriter template is a file created in Microsoft Word that contains merge fields.

The WordTemplate object is in the SoftArtisans.WordWriter namespace. The object can be referenced as SoftArtisans.WordWriter.WordTemplate. To minimize typing and errors, use an Import directive to import the namespace to the aspx page, and reference the object as WordTemplate, without the namespace prefix. If you are coding directly in the .aspx page, following the Page directive, include:

	<%@ Import Namespace="SoftArtisans.WordWriter" %>

If you are coding in the "code behind" page (.aspx.vb or .aspx.cs), include an Imports or Using statement at the top of the "code behind" page:

	In VB.NET: 	Imports SoftArtisans.WordWriter
	In C#:	 using SoftArtisans.WordWriter

To create an instance of the WordTemplate object use:

	In VB.NET:	Dim oWW As New WordTemplate()
	In C#:WordTemplate oWW = new WordTemplate();
WordTemplate Methods
Open

The Open method opens a WordWriter Template.

SetCultureInfo The SetCultureInfo method allows you to override the server's default locale when generating a new Word file.
SetDataSource

The SetDataSource method sets a data source to bind to the merge fields in a WordWriter template file. The data source may be an ADO.NET DataSet or DataTable, or an array.

GetVersion

The GetVersion method returns the exact version of WordWriter.

Process

The Process method enters data source values in a template's merge fields

Save

The Save either saves the generated Word file on the server or streams it to the browser.

ASP.NET Reference: WordTemplate Object Open SetCultureInfo SetDataSource GetVersion Process Save
ASP Reference: WordTemplate Object Open SetCultureInfo SetDataSource GetVersion Process Save


Copyright © 2003, SoftArtisans, Inc.