Project

PSWriteOffice

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

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

New-OfficeTextRun

Aliases: ExcelTextRun, PdfTextRun, PowerPointTextRun, PptTextRun, TextRun, WordTextRun
Module
PSWriteOffice
Aliases
ExcelTextRun PdfTextRun PowerPointTextRun PptTextRun TextRun WordTextRun
Inputs
None
Outputs
PSWriteOffice.Services.Text.OfficeTextRunSpec

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>]
#
Parameter set: All Parameter Sets

Examples

Example 1

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.

Outputs

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