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

Set-OfficeWordTextStyle

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

Updates styling on Word text.

Syntax

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

Examples

Style text inside a Word paragraph.

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

Applies bold red styling to matching text.

Parameters

-Bold Boolean optional
Set or clear bold formatting.
-CapsStyle WordCapsStyle optional
Capitalization style.
Possible values: Caps, SmallCaps
-Color String optional
Text color. Named colors and hexadecimal values are accepted.
-DoubleStrike Boolean optional
Set or clear double strikethrough.
-Emboss Boolean optional
Set or clear emboss effect.
-FontFamily String optional
Font family name.
-FontSize Double optional
Font size in points.
-Highlight WordHighlightColor optional
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 optional
Set or clear italic formatting.
-Outline Boolean optional
Set or clear outline effect.
-PassThru SwitchParameter optional
Emit the updated text item.
-Shadow Boolean optional
Set or clear shadow effect.
-Spacing Int32 optional
Character spacing in twentieths of a point.
-Strike Boolean optional
Set or clear strikethrough.
-Style WordCharacterStyles optional
Character style to apply.
Possible values: DefaultParagraphFont, Heading1Char, Heading2Char, Heading3Char, Heading4Char, Heading5Char, Heading6Char, Heading7Char, Heading8Char, Heading9Char
-StyleId String optional
Character style id to apply.
-Text String optional
Replace the text.
-Underline WordUnderlineStyle optional
Underline style to apply.
Possible values: Single, Words, Double, Thick, Dotted, DottedHeavy, Dash, DashedHeavy, DashLong, DashLongHeavy, DotDash, DashDotHeavy, DotDotDash, DashDotDotHeavy, Wave, WavyHeavy, WavyDouble

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.