Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Set-OfficeWordPageSetup

Aliases: WordPageSetup
Module
PSWriteOffice
Aliases
WordPageSetup
Inputs
OfficeIMO.Word.WordDocument OfficeIMO.Word.WordSection
Outputs
OfficeIMO.Word.WordSection

Sets page setup options on Word sections.

Syntax

Set-OfficeWordPageSetup
[-Bottom <Int32>]
[-Columns <Int32>]
[-ColumnSeparator <Boolean>]
[-ColumnSpacing <Int32>]
[-Footer <Int32>]
[-Gutter <Int32>]
[-Header <Int32>]
[-Left <Int32>]
[-Margin <WordMargin>]
[-Orientation <Portrait|Landscape>]
[-PageSize <WordPageSize>]
[-PassThru]
[-Right <Int32>]
[-Top <Int32>]
[<CommonParameters>]
#
Parameter set: Current
Set-OfficeWordPageSetup
[-Bottom <Int32>]
[-Columns <Int32>]
[-ColumnSeparator <Boolean>]
[-ColumnSpacing <Int32>]
[-Footer <Int32>]
[-Gutter <Int32>]
[-Header <Int32>]
[-Left <Int32>]
[-Margin <WordMargin>]
[-Orientation <Portrait|Landscape>]
[-PageSize <WordPageSize>]
[-PassThru]
[-Right <Int32>]
-Section <WordSection>
[-Top <Int32>]
[<CommonParameters>]
#
Parameter set: Section
Set-OfficeWordPageSetup
[-Bottom <Int32>]
[-Columns <Int32>]
[-ColumnSeparator <Boolean>]
[-ColumnSpacing <Int32>]
-Document <WordDocument>
[-Footer <Int32>]
[-Gutter <Int32>]
[-Header <Int32>]
[-Index <Int32[]>]
[-Left <Int32>]
[-Margin <WordMargin>]
[-Orientation <Portrait|Landscape>]
[-PageSize <WordPageSize>]
[-PassThru]
[-Right <Int32>]
[-Top <Int32>]
[<CommonParameters>]
#
Parameter set: Document

Description

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

Examples

Use landscape A4 with two columns.

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

Updates the current section page setup.

Parameters

-Bottom Int32 optional
Bottom margin in twips.
-Columns Int32 optional
Number of section columns.
-ColumnSeparator Boolean optional
Whether to show a separator between columns.
-ColumnSpacing Int32 optional
Space between columns in twips.
Footer distance in twips.
-Gutter Int32 optional
Gutter size in twips.
-Header Int32 optional
Header distance in twips.
-Left Int32 optional
Left margin in twips.
-Margin WordMargin optional
Built-in margin preset.
Possible values: Normal, Mirrored, Moderate, Narrow, Wide, Office2003Default, Unknown
-Orientation OfficePageOrientation optional
Page orientation.
Possible values: Portrait, Landscape
-PageSize WordPageSize optional
Built-in page size.
Possible values: Unknown, Letter, Legal, Statement, Executive, A3, A4, A5, A6, B5, Tabloid, B4Jis, Envelope9, Envelope10, CSheet, EnvelopeDl, EnvelopeC5, EnvelopeC4, EnvelopeB5, EnvelopeMonarch
-PassThru SwitchParameter optional
Emit updated sections.
-Right Int32 optional
Right margin in twips.
-Top Int32 optional
Top margin in twips.
-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.