# New-OfficeTextRun

Creates a reusable rich text run specification for Word, Excel, PowerPoint, and PDF commands.

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **727**

Forks **84**

Open issues **7**

Total downloads **5,275,783**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-24

Cmdlet 

Aliases: ExcelTextRun, PdfTextRun, PowerPointTextRun, PptTextRun, TextRun, WordTextRun

**Module**

`PSWriteOffice`

**Aliases**

`ExcelTextRun` `PdfTextRun` `PowerPointTextRun` `PptTextRun` `TextRun` `WordTextRun`

**Inputs**

`None`

**Outputs**

`PSWriteOffice.Services.Text.OfficeTextRunSpec`

**Source**

[NewOfficeTextRunCommand.cs:10](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Text/NewOfficeTextRunCommand.cs#L10) 

Creates a reusable rich text run specification for Word, Excel, PowerPoint, and PDF commands.

## Syntax

```
New-OfficeTextRun
[-BackgroundColor <String>]
[-Baseline <String>]
[-Bold]
[-Color <String>]
[-FontName <String>]
[-FontSize <Double>]
[-Italic]
[-Kind <String>]
[-LinkContents <String>]
[-LinkDestinationName <String>]
[-LinkUri <String>]
[-Strike]
[-TabAlignment <String>]
[-TabLeader <String>]
[[-Text] <String>]
[-Underline]
[-UnderlineStyle <String>]
[<CommonParameters>]
```

[#](#method-new-officetextrun-string-string-switchparameter-string-string-double-switchparameter-string-string-string-string-switchparameter-string-string-string-switchparameter-string)

Parameter set: `All Parameter Sets`

## Examples

### Example 1

```powershell
New-OfficeTextRun -BackgroundColor 'Value'
```

## Parameters

**-BackgroundColor String optionalaliases: FillColor, HighlightColor**

Run background or highlight color. Named colors and hexadecimal colors are accepted; None clears the background or highlight where supported.

**-Baseline String optional**

Target-specific baseline name, such as Superscript or Subscript.

**-Bold SwitchParameter optional**

Render the run in bold.

**-Color String optionalaliases: FontColor, TextColor**

Text color. Named colors and hexadecimal colors are accepted.

**-FontName String optionalaliases: Font, FontFamily, Typeface**

Font name, family, or target-specific font identifier.

**-FontSize Double optional**

Font size in points.

**-Italic SwitchParameter optional**

Render the run in italics.

**-Kind String optional**

Run kind such as Text, LineBreak, Tab, Superscript, or Subscript.

**-LinkContents String optionalaliases: Contents, Tooltip**

Optional link tooltip or annotation contents.

**-LinkDestinationName String optionalaliases: Bookmark, BookmarkName, DestinationName**

Named destination or bookmark target when supported by the target format.

**-LinkUri String optionalaliases: Href, Uri, Url**

URI link target when supported by the target format.

**-Strike SwitchParameter optional**

Render the run with strikethrough.

**-TabAlignment String optionalaliases: Alignment**

Tab alignment name.

**-TabLeader String optionalaliases: Leader**

PDF tab leader style name.

**-Text String optionalposition: 0**

Run text.

**-Underline SwitchParameter optional**

Render the run with underline.

**-UnderlineStyle String optional**

Optional underline style name when the target format supports it.

## Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see [about_CommonParameters](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

## Outputs

PSWriteOffice.Services.Text.OfficeTextRunSpec: PowerShell-friendly rich text run specification used by document adapters.

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:22466CC4757AD39F51332817218CFE55EE73FCD2DED7031C7040C70C4E8F734A -->
