LoadTemplate Method
- Namespace
TXTextControl.DocumentServer
- Package
TXTextControl.asTextControl. Core. SDK TXDocumentServer.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXDocumentServer.dll
Description
Loads a template from a file that is used for the merge process.
Syntax
public bool LoadTemplate(string filename, FileFormat documentFormat);Public Function LoadTemplate(filename As String, documentFormat As FileFormat) As BooleanParameters
| Parameter | Description |
|---|---|
| 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.");
}If mailMerge.LoadTemplate("document.docx", TXTextControl.DocumentServer.FileFormat.MSWord) Then
Console.WriteLine("Load Template completed successfully.")
End If