API Reference

Cmdlet

Add-OfficeWordSection

Aliases: WordSection

Adds or reuses a section inside the current Word document.

Remarks

Provides the DSL entry point for section-level operations inside New-OfficeWord.

Examples

Authored help example

Example 1: Create a section with a paragraph.

PS>


New-OfficeWord -Path .\doc.docx { Add-OfficeWordSection { Add-OfficeWordParagraph -Text 'Hello' } }
        

Creates a document and inserts a section that contains a single 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

Add-OfficeWordSection [-BreakType <NextPage|NextColumn|Continuous|EvenPage|OddPage>] [-Content <ScriptBlock>] [-PassThru] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

BreakType WordSectionBreakType optionalposition: namedpipeline: Falsevalues: 5
Optional section break type.
Possible values: NextPage, NextColumn, Continuous, EvenPage, OddPage
Content ScriptBlock optionalposition: 0pipeline: False
DSL scriptblock executed within the section scope.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the created WordSection.