Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Get-OfficeWordTable

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

Gets tables from a Word document or section.

Remarks

Gets tables from a Word document or section.

Examples

Authored help example

Count top-level and nested tables.

PS>


$tables = Get-OfficeWordTable -Path .\Report.docx -IncludeNested
            [pscustomobject]@{
                Path = '.\Report.docx'
                TableCount = @($tables).Count
            }
        

Reads tables from the document and includes nested tables when validating a composed report.

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-OfficeWordTable [-IncludeNested] -Path <String> [<CommonParameters>]
#
Parameter set: Path

Parameters

IncludeNested SwitchParameter optionalposition: namedpipeline: False
Include nested tables.
Path String requiredposition: 0pipeline: Falsealiases: FilePath, InputPath
Path to the document.

Outputs

OfficeIMO.Word.WordTable

Get-OfficeWordTable -Document <WordDocument> [-IncludeNested] [<CommonParameters>]
#
Parameter set: Document

Parameters

Document WordDocument requiredposition: namedpipeline: True (ByValue)
Document to inspect.
IncludeNested SwitchParameter optionalposition: namedpipeline: False
Include nested tables.

Outputs

OfficeIMO.Word.WordTable

Get-OfficeWordTable [-IncludeNested] -Section <WordSection> [<CommonParameters>]
#
Parameter set: Section

Parameters

IncludeNested SwitchParameter optionalposition: namedpipeline: False
Include nested tables.
Section WordSection requiredposition: namedpipeline: True (ByValue)
Section to enumerate.

Outputs

OfficeIMO.Word.WordTable