# Get-OfficeWordText

Gets the text runs of paragraphs, sections or documents.

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`OfficeIMO.Word.WordDocument` `OfficeIMO.Word.WordParagraph` `OfficeIMO.Word.WordSection` `System.String[]`

**Outputs**

`OfficeIMO.Word.WordParagraph`

**Source**

[GetOfficeWordTextCommand.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Word/GetOfficeWordTextCommand.cs#L10) 

Gets the text runs of paragraphs, sections or documents.

## Syntax

```
Get-OfficeWordText
[-Document <WordDocument>]
[<CommonParameters>]
```

[#](#method-get-officewordtext-worddocument)

Parameter set: `Document`

```
Get-OfficeWordText
[-Path] <String[]>
[<CommonParameters>]
```

[#](#method-get-officewordtext-string)

Parameter set: `Path`

```
Get-OfficeWordText
-LiteralPath <String[]>
[<CommonParameters>]
```

[#](#method-get-officewordtext-string-2)

Parameter set: `LiteralPath`

```
Get-OfficeWordText
-Section <WordSection>
[<CommonParameters>]
```

[#](#method-get-officewordtext-wordsection)

Parameter set: `Section`

```
Get-OfficeWordText
-Paragraph <WordParagraph>
[<CommonParameters>]
```

[#](#method-get-officewordtext-wordparagraph)

Parameter set: `Paragraph`

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Create and Edit Word Documents in .NET](/docs/word/) Guide
  
  Create, open, read, edit, and save DOCX files with OfficeIMO.Word, PSWriteOffice, and the officeimo CLI, without Microsoft Word installed.
- [Protect and Encrypt Word Documents](/docs/word/protection/) Guide
  
  Restrict editing of DOCX files to read-only, comments, tracked changes or forms, mark them final, and encrypt or open them with a password in .NET.

## Examples

### Example 1

```powershell
Get-OfficeWordText -Document 'Value'
```

### Example 2

```powershell
Get-OfficeWordText -LiteralPath @('C:\Path')
```

### Example 3

```powershell
Get-OfficeWordText -Paragraph 'Value'
```

## Parameters

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

Document for this inspection.

**-Path String[] requiredposition: 0pipeline: True (ByValue)sets: Path**

Path for this inspection.

**-LiteralPath String[] requiredpipeline: True (ByPropertyName)aliases: FullName, PSPathsets: LiteralPath**

LiteralPath for this inspection.

**-Section WordSection requiredpipeline: True (ByValue)sets: Section**

Section for this inspection.

**-Paragraph WordParagraph requiredpipeline: True (ByValue)sets: Paragraph**

Paragraph for this inspection.

## 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:C576B8956C833FC256798AEF1B5DC9B2D4AC05A073369CC9CD37ABB594892615 -->
