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-OfficeWordParagraphStyle

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

Updates paragraph style, spacing, indentation, and pagination hints.

Remarks

Updates paragraph style, spacing, indentation, and pagination hints.

Examples

Authored help example

Style a paragraph in a Word DSL.

PS>


$p = Add-OfficeWordParagraph -Text 'Executive Summary' -PassThru; $p | Set-OfficeWordParagraphStyle -Style Heading1 -KeepWithNext $true
        

Applies a heading style and keeps it with the next paragraph.

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-OfficeWordParagraphStyle [-Alignment <Left>] [-AvoidWidowAndOrphan <Boolean>] [-BiDi <Boolean>] [-CharacterAlignment <Top|Center|Baseline|Bottom|Auto>] [-IndentationAfterPoints <Double>] [-IndentationBeforePoints <Double>] [-IndentationFirstLinePoints <Double>] [-IndentationHangingPoints <Double>] [-KeepLinesTogether <Boolean>] [-KeepWithNext <Boolean>] [-LineSpacingPoints <Double>] [-LineSpacingRule <Auto|Exact|AtLeast>] [-PageBreakBefore <Boolean>] [-Paragraph <WordParagraph>] [-PassThru] [-SpacingAfterPoints <Double>] [-SpacingBeforePoints <Double>] [-Style <Normal>] [-StyleId <String>] [-TextDirection <LeftToRightTopToBottom>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Alignment WordParagraphAlignment optionalposition: namedpipeline: Falsevalues: 12
Paragraph alignment.
Possible values: Left, Start, Center, Right, End, Both, MediumKashida, Distribute, NumTab, HighKashida, LowKashida, ThaiDistribute
AvoidWidowAndOrphan Boolean optionalposition: namedpipeline: False
Enable widow and orphan control.
BiDi Boolean optionalposition: namedpipeline: False
Set or clear right-to-left paragraph layout.
CharacterAlignment WordVerticalCharacterAlignment optionalposition: namedpipeline: Falsevalues: 5
Vertical character alignment on each line.
Possible values: Top, Center, Baseline, Bottom, Auto
IndentationAfterPoints Double optionalposition: namedpipeline: False
Indentation after the paragraph in points.
IndentationBeforePoints Double optionalposition: namedpipeline: False
Indentation before the paragraph in points.
IndentationFirstLinePoints Double optionalposition: namedpipeline: False
First-line indentation in points.
IndentationHangingPoints Double optionalposition: namedpipeline: False
Hanging indentation in points.
KeepLinesTogether Boolean optionalposition: namedpipeline: False
Keep all paragraph lines together.
KeepWithNext Boolean optionalposition: namedpipeline: False
Keep this paragraph with the next paragraph.
LineSpacingPoints Double optionalposition: namedpipeline: False
Line spacing in points.
LineSpacingRule WordLineSpacingRule optionalposition: namedpipeline: Falsevalues: 3
Line spacing calculation rule.
Possible values: Auto, Exact, AtLeast
PageBreakBefore Boolean optionalposition: namedpipeline: False
Start the paragraph on a new page.
Paragraph WordParagraph optionalposition: 0pipeline: True (ByValue)
Paragraph to update.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated paragraph.
SpacingAfterPoints Double optionalposition: namedpipeline: False
Line spacing after the paragraph in points.
SpacingBeforePoints Double optionalposition: namedpipeline: False
Line spacing before the paragraph in points.
Style WordParagraphStyles optionalposition: namedpipeline: Falsevalues: 12
Paragraph style to apply.
Possible values: Normal, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Heading7, Heading8, Heading9, ListParagraph, Custom
StyleId String optionalposition: namedpipeline: False
Paragraph style id to apply.
TextDirection WordTextDirection optionalposition: namedpipeline: Falsevalues: 12
Paragraph text direction.
Possible values: LeftToRightTopToBottom, LeftToRightTopToBottom2010, TopToBottomRightToLeft, TopToBottomRightToLeft2010, BottomToTopLeftToRight, BottomToTopLeftToRight2010, LeftToRightTopToBottomRotated, LeftToRightTopToBottomRotated2010, TopToBottomRightToLeftRotated, TopToBottomRightToLeftRotated2010, TopToBottomLeftToRightRotated, TopToBottomLeftToRightRotated2010

Outputs

OfficeIMO.Word.WordParagraph