Live TextPart API
Explore the document's text stories
The body, header, footer, and text frame belong to one document, but each is an independent formatted text part with its own selection and collections.
Document story map
Select a region to activate and scroll to that editing surface.
Reading...
0Main text
0Headers / footers
0Text frames
TextParts in collection order
The list is generated from TXTextControl.textParts.
Reading document stories...
Choose a text partUse the page map or collection list to activate a document story.
Active text part
Text part
Main text
This story owns the current input focus.
Collection index-
Text part type-
Paragraphs-
Tables-
Application fields-
Nested frames-
Selection in this storyPosition 0 · Length 0
The marker is inserted only into the active text part. Other document stories remain unchanged.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
One document contains several editing surfaces
A TextPart is a complete formatted-text context: the main document body, a header or footer, or the editable content of a text frame. Each part exposes its own selection and collections without flattening the Word-compatible document structure.
Story collection
TXTextControl.textParts
Story type
FormattedText.textPartType
Activate a story
TextPartCollection.activate
Independent content
FormattedText.selection
How it works
TextPartCollection.getCount and elementAt enumerate every main text part in document order. The modern FormattedText.textPartType property distinguishes mainText, headerFooter, and textFrame without using the obsolete TextPart.type member.
Every returned object inherits the FormattedText surface. That gives each story independent paragraphs, tables, applicationFields, frames, and selection collections. The inspector reads these collections directly, so its numbers reflect the loaded RTF rather than page markup.
TextPartCollection.activate moves the input focus to the selected story and scrolls it into view when necessary. This works consistently for the main body, repeated headers and footers, and positioned text frames.
The marker action activates one part, sets that part's Selection to position zero with length zero, and calls Selection.setText. This demonstrates why automation can update a footer or text frame without modifying similarly positioned content in the main document.
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Provides the browser-based TX Text Control document editor and JavaScript API.
dotnet add package TXTextControl.Web --version 34.4.0
TXTextControl.Web.DocumentEditor.Backend
34.4.0
Hosts the WebSocket-based backend used by the browser document editor.
dotnet add package TXTextControl.Web.DocumentEditor.Backend --version 34.4.0