Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.6.1
.NET Platform

View Docs for Another
Version or Platform

Programmer's Reference > WordTemplate Object

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.OfficeWriter.WordWriter namespace. The object can be referenced as SoftArtisans.WordWriter.WordTemplate. To minimize typing and errors, 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.OfficeWriter.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.OfficeWriter.WordWriter
In C#: using SoftArtisans.OfficeWriter.WordWriter;

To create an instance of the WordTemplate object use:

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

WordTemplate Object

Represents a WordWriter template. A WordWriter template is a file created in Microsoft Word that contains merge fields.

BookmarkFieldMarkers Method Returns the names of all merge fields in the specified bookmark.
Bookmarks Property Returns the names of all bookmarks in a WordWriter template.
ContentType Property Sets or returns the content-type header that will be sent to the browser with the generated Word document.
CultureInfo Property The CultureInfo property allows you to override the server's default locale when generating a new Word file.
DataSourceSeparator Property Use DataSourceSeparator to set the character that separates a data source name from a column name in a data marker.
DocumentsCreatedToday Property Returns the number of documents generated by WordWriter so far, in the 24 hour period that began when the counter was last reset.
FieldMarkers Property Returns the names of all merge fields in the main document.
LicenseKey Property Returns the registered 23-character license key that enables WordWriter.
Open Method Opens a WordWriter template.
Process Method Enters data source values in a template's merge fields, and creates an image of the output file (the new document) in memory.
Save Method Saves the generated Word file on the server or streams it to the client.
SetDataSource Method Sets a main document data source to a DataSet, DataTable, DataReader, or a one-dimensional array of objects.
SetRepeatBlock Method Sets a repeat block data source to a DataSet, DataTable, DataReader, or a one-dimensional, jagged, or rectangular array of objects.
Version Property Returns the exact version of WordWriter.




Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.