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

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

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

Syntax

Set-OfficeWordParagraphStyle
[-Alignment <WordParagraphAlignment>]
[-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 <WordParagraphStyles>]
[-StyleId <String>]
[-TextDirection <WordTextDirection>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Style a paragraph in a Word DSL.

$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.

Parameters

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

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.