# Set-OfficeWordPageSetup

Sets page setup options on Word sections. Review available syntax, parameters, pipeline guidance, and reference details in PSWriteOffice Cmdlet Reference.

Cmdlet 

Aliases: WordPageSetup

**Module**

`PSWriteOffice`

**Aliases**

`WordPageSetup`

**Inputs**

`OfficeIMO.Word.WordDocument` `OfficeIMO.Word.WordSection`

**Outputs**

`OfficeIMO.Word.WordSection`

**Source**

[SetOfficeWordPageSetupCommand.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/PowerShell/PSWriteOffice/Sources/PSWriteOffice/Cmdlets/Word/SetOfficeWordPageSetupCommand.cs#L20) 

Sets page setup options on Word sections.

## Syntax

```
Set-OfficeWordPageSetup
[-Columns <Int32>]
[-ColumnSeparator]
[-ColumnSpacing <OfficeLength>]
[-FooterDistance <OfficeLength>]
[-Gutter <OfficeLength>]
[-HeaderDistance <OfficeLength>]
[-Margin <OfficeLength>]
[-MarginBottom <OfficeLength>]
[-MarginLeft <OfficeLength>]
[-MarginPreset <WordMargin>]
[-MarginRight <OfficeLength>]
[-MarginTop <OfficeLength>]
[-Orientation <Portrait|Landscape>]
[-PageSize <OfficePageSize>]
[-PassThru]
[<CommonParameters>]
```

[#](#member-ea5d8a71e8a51538d91134f1)

Parameter set: `Context`

```
Set-OfficeWordPageSetup
[-Columns <Int32>]
[-ColumnSeparator]
[-ColumnSpacing <OfficeLength>]
[-FooterDistance <OfficeLength>]
[-Gutter <OfficeLength>]
[-HeaderDistance <OfficeLength>]
[-Margin <OfficeLength>]
[-MarginBottom <OfficeLength>]
[-MarginLeft <OfficeLength>]
[-MarginPreset <WordMargin>]
[-MarginRight <OfficeLength>]
[-MarginTop <OfficeLength>]
[-Orientation <Portrait|Landscape>]
[-PageSize <OfficePageSize>]
[-PassThru]
-Section <WordSection>
[<CommonParameters>]
```

[#](#member-92675e6ea5a50d31d95eec43)

Parameter set: `Section`

```
Set-OfficeWordPageSetup
[-Columns <Int32>]
[-ColumnSeparator]
[-ColumnSpacing <OfficeLength>]
-Document <WordDocument>
[-FooterDistance <OfficeLength>]
[-Gutter <OfficeLength>]
[-HeaderDistance <OfficeLength>]
[-Index <Int32[]>]
[-Margin <OfficeLength>]
[-MarginBottom <OfficeLength>]
[-MarginLeft <OfficeLength>]
[-MarginPreset <WordMargin>]
[-MarginRight <OfficeLength>]
[-MarginTop <OfficeLength>]
[-Orientation <Portrait|Landscape>]
[-PageSize <OfficePageSize>]
[-PassThru]
[<CommonParameters>]
```

[#](#member-5fbc688c8a183972987478f3)

Parameter set: `Document`

## Description

Updates page size, orientation, margins, and section columns through OfficeIMO.Word.

## Guides & Samples

Authored walkthroughs and practical samples linked to this command.

- [Add Headers, Footers and Page Numbers](/docs/word/headers-footers/) Guide
  
  Add headers and footers to DOCX files, insert page numbers and "Page X of Y", and use a different first page or odd and even pages with OfficeIMO.Word.

## Examples

### Use landscape A4 with two columns.

```powershell
Add-OfficeWordSection { Set-OfficeWordPageSetup -PageSize A4 -Orientation Landscape -Columns 2 }
```

Updates the current section page setup.

## Parameters

**-Columns Int32 optional**

Number of section columns.

**-ColumnSeparator SwitchParameter optional**

Whether to show a separator between columns.

**-ColumnSpacing OfficeLength optional**

Space between columns in twips.

**-FooterDistance OfficeLength optional**

FooterDistance distance in twips.

**-Gutter OfficeLength optional**

Gutter size in twips.

**-HeaderDistance OfficeLength optional**

HeaderDistance distance in twips.

**-Margin OfficeLength optional**

Uniform physical margin; numbers mean points.

**-MarginBottom OfficeLength optional**

MarginBottom margin in twips.

**-MarginLeft OfficeLength optional**

MarginLeft margin in twips.

**-MarginPreset WordMargin optional**

Built-in margin preset.

Possible values: `Normal`, `Mirrored`, `Moderate`, `Narrow`, `Wide`, `Office2003Default`, `Unknown`

**-MarginRight OfficeLength optional**

MarginRight margin in twips.

**-MarginTop OfficeLength optional**

MarginTop margin in twips.

**-Orientation OfficePageOrientation optional**

Page orientation.

Possible values: `Portrait`, `Landscape`

**-PageSize OfficePageSize optional**

Built-in page size.

**-PassThru SwitchParameter optional**

Emit updated sections.

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

Section to update.

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

Document whose sections should be updated.

**-Index Int32[] optionalsets: Document**

Optional 0-based section indexes when -Document is used.

## 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:6D5F8B1210D9AFBE33BF473FDC3CB0DF1E4203BE969FD7F624DCB21353ACE07F -->
