# OdfTextContent

Native ODF paragraph or inline content. Edits stay in the owning document XML.

Class 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`15caddadea70` with working tree changes

**Source**

[OdfTextContent.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L69)

**Modifiers**

abstract

Native ODF paragraph or inline content. Edits stay in the owning document XML.

## Inheritance

- object
- OdfTextContent

## Derived Types

- [OdfTextHyperlink](/api/open-document/officeimo-opendocument-odftexthyperlink/)
- [OdfTextParagraph](/api/open-document/officeimo-opendocument-odftextparagraph/)
- [OdfTextRun](/api/open-document/officeimo-opendocument-odftextrun/)

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Method [OdfTextContent.AddText](/api/open-document/officeimo-opendocument-odftextcontent/#method-addtext-string)
- Method [OdfTextContent.TransformTextCase](/api/open-document/officeimo-opendocument-odftextcontent/#method-transformtextcase-officeimo-drawing-officetextcase-globalization-cultureinfo)

Filter members 

Show inherited

## Methods

`public OdfTextField AddField(OdfTextFieldKind kind, string? displayText = null)` [#](#method-addfield-officeimo-opendocument-odftextfieldkind-string)

[OdfTextContent.cs:84](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L84)

Appends a basic native field with cached display text.

Parameters

**kind OfficeIMO.OpenDocument.OdfTextFieldKind required**

**displayText string? = null optional**

Returns

`OdfTextField`

`public OdfTextHyperlink AddHyperlink(string text, string href)` [#](#method-addhyperlink-string-string)

[OdfTextContent.cs:77](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L77)

Appends a hyperlink without fetching or resolving its target.

Parameters

**text string required**

**href string required**

Returns

`OdfTextHyperlink`

`public OdfTextRun AddRun(string? text = null)` [#](#method-addrun-string)

[OdfTextContent.cs:72](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L72)

Appends a styled run, retaining existing nodes.

Parameters

**text string? = null optional**

Returns

`OdfTextRun`

`public OdfTextContent AddText(string text)` [#](#method-addtext-string)

[OdfTextContent.cs:69](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L69)

Appends text using ODF space, tab, and line-break encoding.

Parameters

**text string required**

Returns

`OdfTextContent`

`public XElement ToXml()` [#](#method-toxml)

[OdfTextContent.cs:91](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L91)

Returns a detached copy of this native element.

Returns

`XElement`

`public OdfTextContent TransformTextCase(OfficeTextCase textCase, CultureInfo? culture = null)` [#](#method-transformtextcase-officeimo-drawing-officetextcase-globalization-cultureinfo)

[OdfTextContent.cs:88](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L88)

Transforms stored text while retaining inline XML and excluding annotations and embedded objects.

Parameters

**textCase OfficeIMO.Drawing.OfficeTextCase required**

**culture System.Globalization.CultureInfo? = null optional**

Returns

`OdfTextContent`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string Text { get; set; }` [#](#property-text)

[OdfTextContent.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L15)

Decoded text. Assignment replaces this element's child content, including nested formatting and fields.

`public string? StyleName { get; set; }` [#](#property-stylename)

[OdfTextContent.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L17)

Referenced native style name.

`public IReadOnlyList<OdfTextNode> InlineNodes { get; }` [#](#property-inlinenodes)

[OdfTextContent.cs:19](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L19)

Ordered inline syntax. Text values are snapshots; typed wrappers edit the original XML.

`public IReadOnlyList<OdfTextRun> Runs { get; }` [#](#property-runs)

[OdfTextContent.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L21)

Styled runs in this content's text story, including nested runs.

`public IReadOnlyList<OdfTextHyperlink> Hyperlinks { get; }` [#](#property-hyperlinks)

[OdfTextContent.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L24)

Hyperlinks in this content's text story, including links inside runs.

`public IReadOnlyList<OdfTextField> Fields { get; }` [#](#property-fields)

[OdfTextContent.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L27)

Basic page, date, and time fields in this content's text story.

`public bool? Bold { get; set; }` [#](#property-bold)

[OdfTextContent.cs:31](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L31)

Effective bold state, including inline, paragraph, and graphic inheritance.

`public bool? Italic { get; set; }` [#](#property-italic)

[OdfTextContent.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L33)

Effective italic state.

`public bool? Underline { get; set; }` [#](#property-underline)

[OdfTextContent.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L35)

Effective underline state.

`public OdfTextDecorationStyle? UnderlineStyle { get; set; }` [#](#property-underlinestyle)

[OdfTextContent.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L37)

Effective native underline style.

`public OdfTextDecorationType? UnderlineType { get; set; }` [#](#property-underlinetype)

[OdfTextContent.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L39)

Effective native underline line count.

`public bool? Strikethrough { get; set; }` [#](#property-strikethrough)

[OdfTextContent.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L41)

Effective strike-through state.

`public OdfLength? FontSize { get; set; }` [#](#property-fontsize)

[OdfTextContent.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L43)

Effective font size.

`public string? FontFamily { get; set; }` [#](#property-fontfamily)

[OdfTextContent.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L45)

Effective font family.

`public OdfColor? Color { get; set; }` [#](#property-color)

[OdfTextContent.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L47)

Effective text color.

`public double? TextOpacity { get; set; }` [#](#property-textopacity)

[OdfTextContent.cs:53](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L53)

Effective text opacity from zero to one, including inline, paragraph and graphic inheritance.

Exceptions

- `InvalidDataException` – The nearest imported opacity declaration is invalid or its aliases conflict.
- `ArgumentOutOfRangeException` – The assigned value is not finite or is outside zero to one.

`public OdfColor? BackgroundColor { get; set; }` [#](#property-backgroundcolor)

[OdfTextContent.cs:58](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L58)

Effective text background. An explicit transparent override stops inheritance.

`public OdfTextPosition? TextPosition { get; set; }` [#](#property-textposition)

[OdfTextContent.cs:62](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L62)

Effective baseline placement.

`public OdfTextTransform? TextTransform { get; set; }` [#](#property-texttransform)

[OdfTextContent.cs:64](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L64)

Effective display-time case transformation.

`public bool? SmallCaps { get; set; }` [#](#property-smallcaps)

[OdfTextContent.cs:66](https://github.com/EvotecIT/OfficeIMO/blob/15caddadea7080f6e4b3027fdb95451a0210bdb1/OfficeIMO.OpenDocument/Text/OdfTextContent.cs#L66)

Effective small-cap formatting.

<!-- PowerForge markdown artifact sha256:21964EA2AA4E0EC5E9DED0BB6B165F0D67BE7C4F8E7CC64872408A134A982BD4 -->
