Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficeWordText

Module
PSWriteOffice
Inputs
OfficeIMO.Word.WordParagraph
Outputs
OfficeIMO.Word.WordParagraph

Updates styling on Word text.

Syntax

Set-OfficeWordText
[-Bold]
[-CapsStyle <Caps|SmallCaps>]
[-Color <OfficeColor>]
[-DoubleStrikethrough]
[-Emboss]
[-Font <String>]
[-Highlight <WordHighlightColor>]
[-Italic]
[-Outline]
[[-Paragraph] <WordParagraph>]
[-PassThru]
[-Shadow]
[-Size <OfficeLength>]
[-Spacing <Int32>]
[-Strikethrough]
[-Style <WordCharacterStyles>]
[-StyleId <String>]
[-Text <String>]
[-Underline <WordUnderlineStyle>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Style text inside a Word paragraph.

WordParagraph -Text 'Warning' -PassThru | Set-OfficeWordText -Bold -Color '#C00000'

Applies bold red styling to the supplied paragraph or scoped run.

Parameters

-Bold SwitchParameter optional
Set or clear bold formatting.
-CapsStyle WordCapsStyle optional
Capitalization style.
Possible values: Caps, SmallCaps
-Color OfficeColor optional
Text color. Named colors and hexadecimal values are accepted; null clears the direct override.
-DoubleStrikethrough SwitchParameter optional
Set or clear double strikethrough.
-Emboss SwitchParameter optional
Set or clear emboss effect.
-Font String optional
Font family name.
-Highlight WordHighlightColor optional
Highlight color.
Possible values: Black, Blue, Cyan, Green, Magenta, Red, Yellow, White, DarkBlue, DarkCyan, DarkGreen, DarkMagenta, DarkRed, DarkYellow, DarkGray, LightGray
-Italic SwitchParameter optional
Set or clear italic formatting.
-Outline SwitchParameter optional
Set or clear outline effect.
-Paragraph WordParagraph optionalposition: 0pipeline: True (ByValue)
Word text item to update.
-PassThru SwitchParameter optional
Emit the updated text item.
-Shadow SwitchParameter optional
Set or clear shadow effect.
-Size OfficeLength optional
Font size; bare numbers mean points. Null clears the direct size override.
-Spacing Int32 optional
Character spacing in twentieths of a point.
-Strikethrough SwitchParameter 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.