Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Set-OfficeWordParagraph

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

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

Syntax

Set-OfficeWordParagraph
[-Alignment <OfficeAlignment>]
[-AvoidWidowAndOrphan]
[-BiDi]
[-CharacterAlignment <Top|Center|Baseline|Bottom|Auto>]
[-IndentationAfter <OfficeLength>]
[-IndentationBefore <OfficeLength>]
[-IndentationFirstLine <OfficeLength>]
[-IndentationHanging <OfficeLength>]
[-KeepLinesTogether]
[-KeepWithNext]
[-LineSpacing <OfficeLength>]
[-LineSpacingRule <Auto|Exact|AtLeast>]
[-PageBreakBefore]
[[-Paragraph] <WordParagraph>]
[-PassThru]
[-SpacingAfter <OfficeLength>]
[-SpacingBefore <OfficeLength>]
[-Style <WordParagraphStyles>]
[-StyleId <String>]
[-TextDirection <WordTextDirection>]
[<CommonParameters>]
#
Parameter set: Default

Examples

Style a paragraph in a Word DSL.

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

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

Parameters

-Alignment OfficeAlignment optional
Paragraph alignment.
Possible values: Left, Center, Right, Justify, Start, End
-AvoidWidowAndOrphan SwitchParameter optional
Enable widow and orphan control.
-BiDi SwitchParameter 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
-IndentationAfter OfficeLength optional
Indentation after the paragraph; a bare number means points.
-IndentationBefore OfficeLength optional
Indentation before the paragraph; a bare number means points.
-IndentationFirstLine OfficeLength optional
First-line indentation; a bare number means points.
-IndentationHanging OfficeLength optional
Hanging indentation; a bare number means points.
-KeepLinesTogether SwitchParameter optional
Keep all paragraph lines together.
-KeepWithNext SwitchParameter optional
Keep this paragraph with the next paragraph.
-LineSpacing OfficeLength optional
Physical line height; bare numbers mean points. Null clears the direct line-spacing override.
-LineSpacingRule WordLineSpacingRule optional
Line spacing calculation rule.
Possible values: Auto, Exact, AtLeast
-PageBreakBefore SwitchParameter optional
Start the paragraph on a new page.
-Paragraph WordParagraph optionalposition: 0pipeline: True (ByValue)
Paragraph to update.
-PassThru SwitchParameter optional
Emit the updated paragraph.
-SpacingAfter OfficeLength optional
Line spacing after the paragraph; a bare number means points.
-SpacingBefore OfficeLength optional
Line spacing before the paragraph; a bare number means points.
-Style WordParagraphStyles optional
Paragraph style to apply.
Possible values: Normal, Heading1, Heading2, Heading3, Heading4, Heading5, Heading6, Heading7, Heading8, Heading9, ListParagraph, Custom, Title, Subtitle
-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.