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-OfficePowerPointSlideSize

Aliases: PptSlideSize
Module
PSWriteOffice
Aliases
PptSlideSize
Inputs
OfficeIMO.PowerPoint.PowerPointPresentation
Outputs
OfficeIMO.PowerPoint.PowerPointSlideSize

Sets the slide size for a PowerPoint presentation.

Syntax

Set-OfficePowerPointSlideSize
[-PassThru]
[-Portrait]
[-Presentation <PowerPointPresentation>]
-Preset <Screen4x3|Screen16x9|Screen16x10>
[<CommonParameters>]
#
Parameter set: Preset
Set-OfficePowerPointSlideSize
-HeightCm <Double>
[-PassThru]
[-Presentation <PowerPointPresentation>]
-WidthCm <Double>
[<CommonParameters>]
#
Parameter set: Centimeters
Set-OfficePowerPointSlideSize
-HeightInches <Double>
[-PassThru]
[-Presentation <PowerPointPresentation>]
-WidthInches <Double>
[<CommonParameters>]
#
Parameter set: Inches
Set-OfficePowerPointSlideSize
-HeightPoints <Double>
[-PassThru]
[-Presentation <PowerPointPresentation>]
-WidthPoints <Double>
[<CommonParameters>]
#
Parameter set: Points
Set-OfficePowerPointSlideSize
-HeightEmus <Int64>
[-PassThru]
[-Presentation <PowerPointPresentation>]
-WidthEmus <Int64>
[<CommonParameters>]
#
Parameter set: Emus

Description

Supports common presets as well as explicit width and height in centimeters, inches, points, or EMUs.

Examples

Set a standard widescreen presentation size.

New-OfficePowerPoint -Path .\Examples\Documents\PowerPointWidescreen.pptx {
    Set-OfficePowerPointSlideSize -Preset Screen16x9
    Add-OfficePowerPointSlide -Layout 1 -PassThru | Set-OfficePowerPointSlideTitle -Title 'Widescreen deck'
}

Applies the 16:9 widescreen preset before adding slides.

Set a custom size in centimeters.

$ppt = New-OfficePowerPoint -Path .\Examples\Documents\PowerPointCustomSize.pptx -NoSave
Set-OfficePowerPointSlideSize -Presentation $ppt -WidthCm 25.4 -HeightCm 14.0
Add-OfficePowerPointSlide -Presentation $ppt -Layout 1 -PassThru | Set-OfficePowerPointSlideTitle -Title 'Custom size'
$ppt | Close-OfficePowerPoint -Save

Sets the presentation slide size to a custom 25.4 x 14.0 cm layout.

Parameters

-PassThru SwitchParameter optional
Emit the object created or changed by the command.
-Portrait SwitchParameter optionalsets: Preset
Apply the preset in portrait orientation.
-Presentation PowerPointPresentation optionalpipeline: True (ByValue)
Presentation to update (optional inside New-OfficePowerPoint).
-Preset PowerPointSlideSizePreset requiredsets: Preset
Preset slide size to apply.
Possible values: Screen4x3, Screen16x9, Screen16x10
-HeightCm Double requiredsets: Centimeters
Custom slide height in centimeters.
-WidthCm Double requiredsets: Centimeters
Custom slide width in centimeters.
-HeightInches Double requiredsets: Inches
Custom slide height in inches.
-WidthInches Double requiredsets: Inches
Custom slide width in inches.
-HeightPoints Double requiredsets: Points
Custom slide height in points.
-WidthPoints Double requiredsets: Points
Custom slide width in points.
-HeightEmus Int64 requiredsets: Emus
Custom slide height in EMUs.
-WidthEmus Int64 requiredsets: Emus
Custom slide width in EMUs.

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.