DS Server

Javascript: TXTextControl.ApplicationFieldFormat Enumeration

Enumeration|Introduced in 28.0

Description

The possible application field formats.

Members

MemberDescription
NoneUnspecified field format.
MSWordThe field is supported and defined through Microsoft Word.
HighEditThe field is supported and defined through the Heiler HighEdit component.
MSWordTXFormFieldsThis value can only be used with the LoadSettings.ApplicationFieldFormat property.

Examples

The following example uses TXTextControl.ApplicationFieldFormat.MSWord (the field is supported and defined through Microsoft Word.) in a document-editing workflow.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.textParts.getMainText(function(mainText) {
    const applicationFields = mainText.applicationFields;
    applicationFields.getItem(function(applicationField) {
        if (!applicationField) {
            console.warn("No application field is available at the current input position.");
            return;
        }
    
        applicationField.setFormat(
            TXTextControl.ApplicationFieldFormat.MSWord,
            function() {
                console.log("set format completed.");
            }
        );
    }, onTxError);
}, onTxError);

Further Reading

  • Reporting: Merging MS Word Documents with DocVariables –
  • Reporting: Merge Formatted Text into MergeFields Using HTML –
  • ServerTextControl and MailMerge Classes in Windows Forms –
  • Ready-to-use Template: Creating Invoices Using TX Text Control –