# TextPartCollection Class

> An instance of the TextPartCollection class contains all text parts in a TX Text Control document. A text part can either be the document's main text, a text frame, a footnote section or a header or footer. A text frame is represented through a TextFrame object, a header or footer through a HeaderFooter object, a footnote section through a FootnoteSection object and the document's main text is represented through a MainText object. A TextPartCollection object contains all these objects in a geometric order. The first object in the collection is the main text, followed by all text frames in geometric order. At the end of the collection all headers and footers are contained also geometrically ordered. All objects in a text part collection implement the IFormattedText interface. The collection can be obtained with the TextControl.TextParts, WPF.TextControl.TextParts or ServerTextControl.TextParts property. The TextPartCollection class implements the IEnumerable and the ICollection interfaces.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 16.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Implements:** `System.Collections.ICollection`, `System.Collections.IEnumerable`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > TextPartCollection Class
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/#description)
- [Syntax](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/#syntax)
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/#examples)
- [Members](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/#members)

---

## In This Section

- [TextPartCollection.Activate Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/activate-method/llms.txt): Sets the input focus to the specified text part. If the activated text part is not in the visible part of the document, the document is scrolled.
- [TextPartCollection.CopyTo Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/copyto-method/llms.txt): Copies the elements of the collection to an array, starting at a particular index.
- [TextPartCollection.Count Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/count-property/llms.txt): Gets the number of elements contained in the collection.
- [TextPartCollection.GetEnumerator Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/getenumerator-method/llms.txt): Returns an enumerator that can be used to iterate through the collection.
- [TextPartCollection.GetItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/getitem-method/llms.txt): Gets a certain text part from the collection.
- [TextPartCollection.GetMainText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/getmaintext-method/llms.txt): Gets the main text part of the document.

---

## Nearby

- **Previous:** [TextFrameInsertionMode Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textframeinsertionmode/enumeration/llms.txt)
- **Next:** [TextPartCollection.Activate Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textpartcollection/activate-method/llms.txt)
