# Remove-OfficeWordTableOfContents

Removes the table of contents from a Word document.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Word.WordDocument`

**Source**

[RemoveOfficeWordTableOfContentsCommand.cs:17](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Word/RemoveOfficeWordTableOfContentsCommand.cs#L17) 

Removes the table of contents from a Word document.

## Syntax

```
Remove-OfficeWordTableOfContents
[-Document <WordDocument>]
[-PassThru]
[<CommonParameters>]
```

[#](#method-remove-officewordtableofcontents-worddocument-switchparameter)

Parameter set: `Default`

## Examples

### Remove a table of contents from an opened document.

```powershell
$doc = Open-OfficeWord -Path .\Report.docx
$doc | Remove-OfficeWordTableOfContents -PassThru |
    Save-OfficeWord -Path .\Report-NoToc.docx
```

Removes the TOC from an OfficeIMO document object and saves the changed document to a new file.

## Parameters

**-Document WordDocument optionalpipeline: True (ByValue)**

Document to modify when provided explicitly.

**-PassThru SwitchParameter optional**

Emit the document after removal.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

<!-- PowerForge markdown artifact sha256:37BA35C8C6923873057185C1FF65650C9B2FCE84C8BB93FA27C75A71017AB375 -->
