Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Set-OfficeWordTextStyle

Aliases: WordTextStyle
Namespace PSWriteOffice
Aliases
WordTextStyle
Inputs
OfficeIMO.Word.WordParagraph
Outputs
OfficeIMO.Word.WordParagraph

Updates styling on Word text.

Remarks

Updates styling on Word text.

Examples

Authored help example

Style text inside a Word paragraph.

PS>


WordParagraph -Text 'Warning' -PassThru | Set-OfficeWordTextStyle -Bold $true -Color '#C00000'
        

Applies bold red styling to matching text.

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.

Syntax

Set-OfficeWordTextStyle [-Bold <Boolean>] [-CapsStyle <Caps|SmallCaps>] [-Color <String>] [-DoubleStrike <Boolean>] [-Emboss <Boolean>] [-FontFamily <String>] [-FontSize <Int32>] [-Highlight <Black>] [-InputObject <WordParagraph>] [-Italic <Boolean>] [-Outline <Boolean>] [-PassThru] [-Shadow <Boolean>] [-Spacing <Int32>] [-Strike <Boolean>] [-Style <DefaultParagraphFont>] [-StyleId <String>] [-Text <String>] [-Underline <Single>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Bold Boolean optionalposition: namedpipeline: False
Set or clear bold formatting.
CapsStyle WordCapsStyle optionalposition: namedpipeline: Falsevalues: 2
Capitalization style.
Possible values: Caps, SmallCaps
Color String optionalposition: namedpipeline: False
Text color. Named colors and hexadecimal values are accepted.
DoubleStrike Boolean optionalposition: namedpipeline: False
Set or clear double strikethrough.
Emboss Boolean optionalposition: namedpipeline: False
Set or clear emboss effect.
FontFamily String optionalposition: namedpipeline: False
Font family name.
FontSize Int32 optionalposition: namedpipeline: False
Font size in points.
Highlight WordHighlightColor optionalposition: namedpipeline: Falsevalues: 16
Highlight color.
Possible values: Black, Blue, Cyan, Green, Magenta, Red, Yellow, White, DarkBlue, DarkCyan, DarkGreen, DarkMagenta, DarkRed, DarkYellow, DarkGray, LightGray
InputObject WordParagraph optionalposition: 0pipeline: True (ByValue)
Word text item to update.
Italic Boolean optionalposition: namedpipeline: False
Set or clear italic formatting.
Outline Boolean optionalposition: namedpipeline: False
Set or clear outline effect.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated text item.
Shadow Boolean optionalposition: namedpipeline: False
Set or clear shadow effect.
Spacing Int32 optionalposition: namedpipeline: False
Character spacing in twentieths of a point.
Strike Boolean optionalposition: namedpipeline: False
Set or clear strikethrough.
Style WordCharacterStyles optionalposition: namedpipeline: Falsevalues: 10
Character style to apply.
Possible values: DefaultParagraphFont, Heading1Char, Heading2Char, Heading3Char, Heading4Char, Heading5Char, Heading6Char, Heading7Char, Heading8Char, Heading9Char
StyleId String optionalposition: namedpipeline: False
Character style id to apply.
Text String optionalposition: namedpipeline: False
Replace the text.
Underline WordUnderlineStyle optionalposition: namedpipeline: Falsevalues: 17
Underline style to apply.
Possible values: Single, Words, Double, Thick, Dotted, DottedHeavy, Dash, DashedHeavy, DashLong, DashLongHeavy, DotDash, DashDotHeavy, DotDotDash, DashDotDotHeavy, Wave, WavyHeavy, WavyDouble

Outputs

OfficeIMO.Word.WordParagraph