API Reference

Cmdlet

Get-OfficeWordSection

Namespace PSWriteOffice
Inputs
OfficeIMO.Word.WordDocument
Outputs
OfficeIMO.Word.WordSection

Gets sections from a Word document.

Remarks

Gets sections from a Word document.

Examples

Authored help example

Example 1: Inspect the first section before section-level reads.

PS>


$section = Get-OfficeWordSection -Path .\Report.docx -Index 0
            $section |
                Get-OfficeWordParagraph |
                Select-Object -First 5 -Property Text
        

Gets a specific section by zero-based index and pipes it to another thin Word reader.

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

Get-OfficeWordSection [-Index <Int32[]>] -InputPath <String> [<CommonParameters>]
#
Parameter set: Path

Parameters

Index Int32[] optionalposition: namedpipeline: False
Optional 0-based section index filter.
InputPath String requiredposition: 0pipeline: Falsealiases: FilePath, Path
Path to the document.

Outputs

OfficeIMO.Word.WordSection

Get-OfficeWordSection -Document <WordDocument> [-Index <Int32[]>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document WordDocument requiredposition: namedpipeline: True (ByValue)
Document to inspect.
Index Int32[] optionalposition: namedpipeline: False
Optional 0-based section index filter.

Outputs

OfficeIMO.Word.WordSection