TX Text Control .NET for Windows Forms

LoadTemplate Method

Method|Introduced in 14.0
Namespace
TXTextControl.DocumentServer
Package
TXTextControl.TextControl.WinForms.SDK as TXDocumentServer.dll from the private NuGet feed or Text Control Offline Packages

Description

Loads a template from a file that is used for the merge process.

Syntax

public bool LoadTemplate(string filename, FileFormat documentFormat);

Parameters

ParameterDescription
filename

Specifies a template file from which the data is loaded.

documentFormat

Specifies one of the DocumentServer.FileFormat values.

Return Value

Returns true, if the template could be loaded successfully and false, if the template is invalid or could not be loaded properly.

Examples

The following example uses Load Template in a focused Mail Merge workflow.

if (mailMerge.LoadTemplate("document.docx", TXTextControl.DocumentServer.FileFormat.MSWord))
{
    Console.WriteLine("Load Template completed successfully.");
}