# OneNoteTextRun

A formatted text run. Review signatures, members, parameters, type relationships, and available reference details in OfficeIMO.OneNote API Reference.

Class 

`OfficeIMO.OneNote`

**Namespace**

`OfficeIMO.OneNote`

**Assembly**

`OfficeIMO.OneNote`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OneNoteContent.cs:151](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L151)

**Modifiers**

sealed

A formatted text run.

## Inheritance

- object
- OneNoteTextRun

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Read and Write OneNote Notebooks](/docs/onenote/notebooks/) Guide
  
  Open OneNote notebooks from a folder, a .onetoc2 file or a .onepkg export, walk section groups and sections, and write notebooks offline.
- [Read and Edit OneNote Files](/docs/onenote/) Guide
  
  Open OneNote .one section files offline in .NET, list pages and their text, add notes, lists and tags, and create new sections without OneNote, Graph or COM.
- [OfficeIMO.OneNote](/products/onenote/) Guide
  
  Read, create, edit, and write native OneNote sections, notebooks, tables of contents, and packages offline. Compare packages, examples, and limits.
- [Read and Convert OneNote Files Offline in .NET](/solutions/offline-onenote-automation/) Guide
  
  Read native OneNote .one, .onetoc2, and .onepkg files offline in .NET, then export pages to images, HTML, Markdown, PDF, or search chunks.

## Usage

Explore 4 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 4

- Method [OneNoteParagraph.AddMath](/api/onenote/officeimo-onenote-onenoteparagraph/#method-addmath-officeimo-drawing-officemathexpression)
- Property [OneNoteParagraph.Runs](/api/onenote/officeimo-onenote-onenoteparagraph/#property-runs)
- Method [OneNoteTextRun.SetMathExpression](/api/onenote/officeimo-onenote-onenotetextrun/#method-setmathexpression-officeimo-drawing-officemathexpression)
- Method [OneNoteTextRun.TransformTextCase](/api/onenote/officeimo-onenote-onenotetextrun/#method-transformtextcase-officeimo-drawing-officetextcase-globalization-cultureinfo)

Filter members 

Show inherited

## Constructors

`public OneNoteTextRun()` [#](#constructor-ctor)

[OneNoteContent.cs:151](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L151)

## Methods

`public OneNoteTextRun SetMathExpression(OfficeMathExpression expression)` [#](#method-setmathexpression-officeimo-drawing-officemathexpression)

[OneNoteContent.cs:161](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L161)

Assigns a structured inline mathematical expression and its readable text projection.

Parameters

**expression OfficeIMO.Drawing.OfficeMathExpression required**

Returns

`OneNoteTextRun`

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

[OneNoteContent.cs:174](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L174)

Transforms the stored run text while preserving its native formatting, hyperlink, and opaque properties.

Parameters

**textCase OfficeIMO.Drawing.OfficeTextCase required**

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

Returns

`OneNoteTextRun`

## 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)

[OneNoteContent.cs:151](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L151)

Unicode run text.

`public OfficeMathExpression? MathExpression { get; set; }` [#](#property-mathexpression)

[OneNoteContent.cs:157](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L157)

Optional structured inline mathematical expression. The reusable expression tree is owned by OfficeIMO.Drawing; OneNote maps it to and from the native rich-text math grammar.

`public OneNoteTextStyle Style { get; }` [#](#property-style)

[OneNoteContent.cs:170](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L170)

Run formatting.

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

[OneNoteContent.cs:203](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L203)

Optional hyperlink URI.

`public bool HyperlinkProtected { get; set; }` [#](#property-hyperlinkprotected)

[OneNoteContent.cs:206](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L206)

Whether the hyperlink is protected from editing.

`public IList<OneNoteOpaqueProperty> UnknownProperties { get; }` [#](#property-unknownproperties)

[OneNoteContent.cs:209](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OneNote/Model/OneNoteContent.cs#L209)

Unknown run properties preserved in encoded source order.

<!-- PowerForge markdown artifact sha256:63B9A092A199D6B333E0503B87A973C7132D0CD3F05AC332D299B08C6F43AC1D -->
