TX Text Control ActiveX

What's New in TX Text Control ActiveX 14.0

Topic

Sections came to TX Text Control ActiveX in version 14.0: one document can now mix page sizes, margins, orientations and headers and footers. The version also added the WordprocessingML format (.docx), the import and export of Microsoft Word and Heiler HighEdit fields, and printing on top of your own page content.

Because page settings now belong to a section, code written for earlier versions can behave differently. The update notes near the end list what to check when you upgrade from version 13.0.

New Features

  • Section formatting. A document can be split into several sections, so that it has different page sizes and margins and different headers and footers. Users set them in the new Page Setup dialog box, which the SectionFormatDialog method opens. All section attributes and all headers and footers can be set either for a single section or for the complete document.

  • Sections in code. The new SectionCurrent property specifies the part of the document whose section attributes your code changes. Use it together with the PageWidth, PageHeight, PageMarginL, PageMarginT, PageMarginR and PageMarginB properties.

  • Sections in the status bar. The TXStatusBar control shows the number of the section at the text input position, the number of pages and the number of sections in the document.

    The TXStatusBar of TX Text Control ActiveX 34.0, showing Section 1/5 and Page 1/5, the line and column, the language and the zoom factor.

  • Headers and footers. The content and the alignment of headers and footers can differ for each section, and each section can have a special header and footer for its first page. A section that does not need a header or footer of its own can connect it with the header or footer of the previous section; the HeaderFooterConnectedToPrevious property does this. The SectionCurrent property together with all header and footer properties and methods changes the headers and footers of a single section or of the current input section.

  • WordprocessingML format. TX Text Control supports WordprocessingML, the part of the Microsoft Office Open XML format for word processing. It is a ZIP-compressed XML format and the standard format of Microsoft Word. TXTextControl loads and saves files with the extension .docx, and blocks of memory, in this format. The Format parameter of the Load and Save methods accepts a new value for it.

  • Import and export of Microsoft Word fields. TX Text Control imports and exports the Microsoft Word fields of Microsoft Word and RTF documents. For a field of the type txFieldMSWord, the FieldTypeData property returns its arguments and switches. This field type only provides an interface to retrieve and change the data and parameters of such fields; the field logic itself is not implemented. Before loading a document, set the txLoadMSWordFields attribute of the LoadSaveAttribute property to true. The txMSWordFieldTypeNames attribute selects particular types of fields. The FieldNext method was extended to iterate through all such fields in the document.

  • Import and export of Heiler HighEdit fields. TX Text Control imports and exports the Heiler HighEdit fields of RTF documents. For a field of the type txFieldHighEdit, the FieldTypeData property returns its name. Before loading a document, set the txLoadHighEditFields attribute of the LoadSaveAttribute property to true. The FieldNext method iterates through all such fields in the document.

  • Background printing. Additional content such as images or watermarks can be printed on a page. A TXTextControl prints transparently on top of the output that your application adds before it calls the PrintPage method.

New Properties, Methods and Events

Properties

MemberDescription
TXStatusBar.ShowColumnSpecifies whether the status bar shows the column number of the current text input position.
TXStatusBar.ShowLineSpecifies whether the status bar shows the line number of the current text input position.
TXStatusBar.ShowPageSpecifies whether the status bar shows the page number of the current text input position.
TXStatusBar.ShowPageCounterSpecifies whether the status bar shows the number of pages in the document.
TXStatusBar.ShowSectionSpecifies whether the status bar shows the section number of the current text input position.
TXStatusBar.ShowSectionCounterSpecifies whether the status bar shows the number of sections in the document.
TXStatusBar.TextPageCounterReturns or sets the text that appears in front of the page counter.
TXStatusBar.TextSectionReturns or sets the text that appears in the Section field in front of the section number.
TXStatusBar.TextSectionCounterReturns or sets the text that appears in front of the section counter.
TXTextControl.HeaderFooterConnectedToPreviousReturns or sets a value specifying whether a header or footer is connected with the header or footer of the previous section.
TXTextControl.PageOrientationReturns or sets the page orientation, portrait or landscape.
TXTextControl.PageViewStyleDefines the kind of view that displays the page background.
TXTextControl.SectionAtInputPosReturns the number of the section that contains the current text input position.
TXTextControl.SectionBreakKindReturns or sets the kind of section break the section starts with.
TXTextControl.SectionCountReturns the number of sections in the document.
TXTextControl.SectionCurrentReturns or sets the section number for the following properties and methods: PageWidth, PageHeight, PageMarginL, PageMarginT, PageMarginR, PageMarginB, PageOrientation, HeaderFooter, HeaderFooterActivate, HeaderFooterSelect, HeaderFooterPosition, HeaderFooterConnectedToPrevious, Columns, PageBorderAttribute, ColumnDistance, ColumnLineWidth, ColumnLineColor, ColumnWidthsAndDistances, SectionRestartPageNumbering and SectionBreakKind.

Methods

MemberDescription
TXTextControl.SectionFormatDialogOpens the built-in dialog box that sets page settings and designs the headers and footers, for the whole document or for a single section.
TXTextControl.SectionInsertInserts a section break at the text input position or at a specified position.

Events

MemberDescription
TXTextControl.PageChangedOccurs when the text input position has moved to another page.
TXTextControl.SectionChangedOccurs when the text input position has moved to another section.

Extended Properties, Methods and Events

Most of the extensions let a member work on one section, which the SectionCurrent property specifies.

Properties

MemberChange
HeaderFooter propertyExtended to support sections. SectionCurrent specifies a section number.
HeaderFooterPosition propertyExtended to support sections. SectionCurrent determines the section that the header or footer belongs to.
HeaderFooterAtInputPos propertyExtended to support sections. SectionCurrent receives the number of the section that the header or footer belongs to.
PageHeight propertyExtended to support sections. SectionCurrent specifies a section number.
PageMarginL propertyExtended to support sections. SectionCurrent specifies a section number.
PageMarginT propertyExtended to support sections. SectionCurrent specifies a section number.
PageMarginR propertyExtended to support sections. SectionCurrent specifies a section number.
PageMarginB propertyExtended to support sections. SectionCurrent specifies a section number.
PageWidth propertyExtended to support sections. SectionCurrent specifies a section number.
LoadSaveAttribute propertyExtended with the txLoadMSWordFields and txLoadHighEditFields attributes, which support the Microsoft Word and Heiler HighEdit fields of Microsoft Word and RTF documents.
FieldType propertyExtended with the txFieldMSWord and txFieldHighEdit field types, which support the Microsoft Word and Heiler HighEdit fields of Microsoft Word and RTF documents.
FieldTypeData propertyExtended with the txFieldMSWord and txFieldHighEdit field types, which support the Microsoft Word and Heiler HighEdit fields of Microsoft Word and RTF documents.

Methods

MemberChange
HeaderFooterActivate methodExtended to support sections. SectionCurrent determines the section whose header or footer is activated.
HeaderFooterSelect methodExtended to support sections. SectionCurrent determines the section whose header or footer is selected.
FieldNext methodExtended to support fields of the types txFieldMSWord and txFieldHighEdit.

Events

MemberChange
HeaderFooterActivated eventExtended to support sections. SectionCurrent receives the number of the section that the header or footer belongs to.
HeaderFooterDeactivated eventExtended to support sections. SectionCurrent receives the number of the section that the header or footer belongs to.

Update Notes

FeatureUpdate note
HeaderFooterSelect methodEarlier versions of TX Text Control accepted txMain as a parameter to deselect a header or footer, although the manual did not allow it. It was invalid before but did not cause an error. Version 14.0 improves the error handling: to deselect a header or footer, pass the value 0 (automatic mode).
HeaderFooterSelect methodEarlier versions also allowed selecting a footer while a header was selected. In version 14.0, a header or footer can be selected only in automatic mode. Headers and Footers describes the details.
Sections and page settingsBefore version 14.0, properties such as PageHeight and PageWidth always applied to the entire document. In version 14.0, each section of a document can have its own page settings. If you use one of the page properties without selecting a section first, it affects all sections.
Page orientation, portrait and landscapeThis incompatibility can occur with the internal format of TX Text Control; other formats, including DOC, RTF and HTML, are not affected. Earlier versions simulated landscape orientation by exchanging the width and height of a document. The new landscape mode of version 14.0 does not recognize this simulated landscape mode and displays a document formatted this way in portrait orientation.