Products Technologies Demo Docs Blog Support Company

TX Text Control 16.0: New TextPartCollection

TX Text Control .NET for WPF 16.0 and TX Text Control .NET for Windows Forms 16.0 come with a new collection: TextPartCollection. It is a kind of meta collection that allows the iteration of text parts such as tables or text fields in all document parts (main text, headers, footers or text frames). This is useful to access all available collections via one standard interface. The following diagram shows the TextParts in detail: Consider the following application: A document template consists…

TX Text Control 16.0: New TextPartCollection

TX Text Control .NET for WPF 16.0 and TX Text Control .NET for Windows Forms 16.0 come with a new collection: TextPartCollection. It is a kind of meta collection that allows the iteration of text parts such as tables or text fields in all document parts (main text, headers, footers or text frames). This is useful to access all available collections via one standard interface. The following diagram shows the TextParts in detail:

Consider the following application: A document template consists of ApplicationFields in the main text, in headers and footers and in several text frames. And you want to replace the text in all of these fields. With previous versions, you had to iterate through all sections, it's contained headers and footers and throught all text frames separately. Now, just one loop is required to get access to all ApplicationFields:

foreach (object obj in textControl1.TextParts)
{
    foreach (ApplicationField field in ((IFormattedText)obj).ApplicationFields)
    {
        field.Text = "New text";
    }
}

It's that easy. The IFormattedText interface contains properties and methods common to all text parts in a TX Text Control document like in this case the ApplicationFieldCollection. Test it on your own and download a trial version today:

TX Text Control Trial Versions

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

Related Posts

ASP.NETWindows FormsWPF

TX Text Control 33.0 SP3 is Now Available: What's New in the Latest Version

TX Text Control 33.0 Service Pack 3 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…


ASP.NETASP.NET CoreDocument Viewer

High-Performance Text Replacement in Large DOCX Files using C# .NET

Learn how to efficiently replace text in large DOCX files using C# .NET and the ServerTextControl component from Text Control. This article demonstrates the performance benefits of using the…


ASP.NETASP.NET CoreDocument Viewer

Document Viewer 33.2.1 Released: New Event and Bug Fixes

This service pack includes important bug fixes and improvements to enhance the stability and performance of the Document Viewer. In addition, a new event has been introduced to provide developers…


ASP.NETAccessibilityASP.NET Core

Upcoming Support for PDF/UA Compliance and Tagged PDF Generation in Version 34.0

We are happy to announce that version 34.0 will support PDF/UA compliance and the creation of tagged PDF documents. This significant update demonstrates our ongoing commitment to accessibility by…


ASP.NETWindows FormsWPF

TX Text Control 33.0 SP2 is Now Available: What's New in the Latest Version

TX Text Control 33.0 Service Pack 2 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…