API Reference
Add-OfficeWordSection
Adds or reuses a section inside the current Word document.
Remarks
Provides the DSL entry point for section-level operations inside New-OfficeWord.
Examples
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.
Add a section to a live document.
PS>
$section = $document | Add-OfficeWordSection -BreakType NextPage -PassThru
$section | Add-OfficeWordParagraph -Text 'Appendix' -Style Heading1
Adds a section through the document pipeline and uses the returned section as the next explicit target.
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>]#ContextParameters
- BreakType WordSectionBreakType
- Optional section break type.
- Possible values:
NextPage,NextColumn,Continuous,EvenPage,OddPage - Content ScriptBlock
- DSL scriptblock executed within the section scope.
- PassThru SwitchParameter
- Emit the created WordSection.
Outputs
OfficeIMO.Word.WordSection
Add-OfficeWordSection [-BreakType <NextPage|NextColumn|Continuous|EvenPage|OddPage>] [-Content <ScriptBlock>] -Document <WordDocument> [-PassThru] [<CommonParameters>]#DocumentParameters
- BreakType WordSectionBreakType
- Optional section break type.
- Possible values:
NextPage,NextColumn,Continuous,EvenPage,OddPage - Content ScriptBlock
- DSL scriptblock executed within the section scope.
- Document WordDocument
- Document that will receive a new section.
- PassThru SwitchParameter
- Emit the created WordSection.
Outputs
OfficeIMO.Word.WordSection