# IFormattedText Interface

> The IFormattedText interface contains properties and methods common to all text parts in a TX Text Control document. A TX Text Control document consists of the document's main text and additional pieces of text like text frames, headers and footers and footnote sections. A single text part has lines, paragraphs, characters and a selection which can be used to assign character and paragraph formatting attributes to a piece of text. Additionally a text part can contain tables, images, text fields, hypertext links and misspelled words. The following classes implement this interface: TextControl, ServerTextControl, WPF.TextControl, TextFrame, HeaderFooter, MainText, FootnoteSection and FootnoteText.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Interface
- **Introduced:** 16.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Implemented by:** `TXTextControl.FootnoteSection`, `TXTextControl.FootnoteText`, `TXTextControl.HeaderFooter`, `TXTextControl.MainText`, `TXTextControl.ServerTextControl`, `TXTextControl.TextFrame`, `TXTextControl.TextPartBase`, `TXTextControl.WPF.TextControl`
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > IFormattedText Interface
- **2122 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/llms-full.txt

---

### Description

The IFormattedText interface contains properties and methods common to all text parts in a TX Text Control document. A TX Text Control document consists of the document's main text and additional pieces of text like text frames, headers and footers and footnote sections. A single text part has lines, paragraphs, characters and a selection which can be used to assign character and paragraph formatting attributes to a piece of text. Additionally a text part can contain tables, images, text fields, hypertext links and misspelled words. The following classes implement this interface: [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/llms-full.txt), [ServerTextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/servertextcontrol/llms-full.txt), [WPF.TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/llms-full.txt), [TextFrame](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/textframe/llms-full.txt), [HeaderFooter](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/headerfooter/llms-full.txt), [MainText](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/maintext/llms-full.txt), [FootnoteSection](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/footnotesection/llms-full.txt) and [FootnoteText](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/footnotetext/llms-full.txt).

### Syntax

```csharp
public interface IFormattedText
```

```vbnet
Public Interface IFormattedText
```

### Examples

The following example shows how to loop through all text parts to get the first line of each part.

```csharp
foreach (object obj in textControl1.TextParts)
{
	Console.WriteLine("First Line: " + ((IFormattedText)obj).Lines[1].Text);
}
```

The following example applies bold formatting through the iformatted text's selection.

```csharp
Selection formattedSelection = iFormattedText.Selection;
formattedSelection.Bold = true;
iFormattedText.Selection = formattedSelection;
```

```vbnet
Dim formattedSelection As Selection = iFormattedText.Selection
formattedSelection.Bold = True
iFormattedText.Selection = formattedSelection
```

---

## In This Section

- [IFormattedText.ApplicationFields Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/applicationfields-property/llms-full.txt): Gets a collection of all Microsoft Word or Heiler HighEdit fields that have been created or imported from a Microsoft Word or RTF document. The property value is an object of the type ApplicationFieldCollection.
- [IFormattedText.Barcodes Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/barcodes-property/llms-full.txt): Gets a collection of all barcodes in the text part. The property value is an object of the type DataVisualization.BarcodeCollection. The collection can be used to get or to alter a barcode's attributes and to add barcodes to or to remove barcodes.
- [IFormattedText.Comments Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/comments-property/llms-full.txt): Gets a collection of all comments in the text part. The property's value is an object of the type CommentCollection.
- [IFormattedText.DocumentLinks Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/documentlinks-property/llms-full.txt): Gets a collection of all links in the text part which point to targets in the same document. The property value is an object of the type DocumentLinkCollection.
- [IFormattedText.DocumentTargets Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/documenttargets-property/llms-full.txt): Gets a collection of all targets in the text part. The property value is an object of the type DocumentTargetCollection.
- [IFormattedText.Drawings Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/drawings-property/llms-full.txt): Gets a collection of all drawings in the text part. The property value is an object of the type DataVisualization.DrawingCollection. The collection can be used to get or to alter a drawing's attributes and to add drawings to or to remove drawings.
- [IFormattedText.EditableRegions Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/editableregions-property/llms-full.txt): Gets a collection of all editable regions in the text part. The property's value is an object of the type EditableRegionCollection.
- [IFormattedText.Find Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/find-method/llms-full.txt): Finds a text string in the text part.
- [IFormattedText.FormFields Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/formfields-property/llms-full.txt): Gets a collection of all form fields in the text part. The property's value is an object of the type FormFieldCollection.
- [IFormattedText.Frames Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/frames-property/llms-full.txt): Gets a collection of all images, textframes, charts, barcodes and drawings in the text part. The property value is an object of the type FrameCollection. The collection can be used to get or to alter common attributes.
- [IFormattedText.GetTextFields Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/gettextfields-method/llms-full.txt): Returns a collection containing text fields of the specified types.
- [IFormattedText.HypertextLinks Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/hypertextlinks-property/llms-full.txt): Gets a collection of all hypertext links in the text part. The property's value is an object of the type HypertextLinkCollection.
- [IFormattedText.Images Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/images-property/llms-full.txt): Gets a collection of all images in the text part. The property value is an object of the type ImageCollection.
- [IFormattedText.Lines Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/lines-property/llms-full.txt): Gets a collection of all lines the text in the text part consists of. The property value is an object of the type LineCollection.
- [IFormattedText.MisspelledWords Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/misspelledwords-property/llms-full.txt): Gets a collection of all misspelled words in the text part. The property value is an object of the type MisspelledWordCollection.
- [IFormattedText.Paragraphs Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/paragraphs-property/llms-full.txt): Gets a collection of all paragraphs the text in the text part consists of. The property value is an object of the type ParagraphCollection.
- [IFormattedText.Selection Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/selection-property/llms-full.txt): Gets or sets the current selection in the text part. The property value is an object of the type Selection. A selection can be used to assign character and paragraph formatting attributes to a piece of text.
- [IFormattedText.SubTextParts Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/subtextparts-property/llms-full.txt): Gets a collection of all subtextparts in the text part. The property's value is an object of the type SubTextPartCollection.
- [IFormattedText.Tables Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/tables-property/llms-full.txt): Gets a collection of all tables in the text part. The property's value is an object of the type TableCollection.
- [IFormattedText.TablesOfContents Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/tablesofcontents-property/llms-full.txt): Gets a collection of all tables of contents. The property's value is an object of the type TableOfContentsCollection.
- [IFormattedText.TextChars Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/textchars-property/llms-full.txt): Gets a collection of all characters the text in the text part consists of. The property value is an object of the type TextCharCollection.
- [IFormattedText.TextFields Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/textfields-property/llms-full.txt): Gets a collection of all standard text fields in the text part. The property's value is an object of the type TextFieldCollection.
- [IFormattedText.TrackedChanges Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/trackedchanges-property/llms-full.txt): Gets a collection of all tracked changes made in the text part. The property's value is an object of the type TrackedChangeCollection.

---

## Nearby

- **Previous:** [HyphenateWordEventArgs.Word Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/hyphenatewordeventargs/word-property/llms-full.txt)
- **Next:** [IFormattedText.ApplicationFields Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/iformattedtext/applicationfields-property/llms-full.txt)
