Search Results for

    Show / Hide Table of Contents

    Interface IWordTextObjectCollection

    Collection of Word text objects

    Namespace: IronWord.Models
    Assembly: IronWord.dll
    Syntax
    public interface IWordTextObjectCollection

    IWordTextObjectCollection gathers every text element in a Word document into one indexable group for C# code to read or rewrite. The contract extends IList<TextContent>, so the text runs behave like a standard list: index them, count them, add and remove entries, and iterate with foreach. Working against the contract keeps content-editing code independent of the concrete collection type while keeping full list semantics over the text.

    The concrete implementor in IronWord is TextObjectCollection, which derives from ObservableCollection<TextContent> and is what code receives when it reaches a document's text. Each element is a TextContent, so every entry carries the text content and identity of a run; the collection layer adds the list operations. The contract also extends the serialization abstraction, so the text set round-trips with the document model. Iterate it to extract or inspect each run, or mutate it to insert and reorder text before saving.

    The add text how-to builds the text up, and the edit text how-to revises it.

    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet