Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Close-OfficePowerPoint

Module PSWriteOffice
Inputs
OfficeIMO.PowerPoint.PowerPointPresentation

Closes a PowerPoint presentation and optionally saves it.

Syntax

Close-OfficePowerPoint [-Open] [-Password <String>] [-Path <String>] -Presentation <PowerPointPresentation> [-Save] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Description

Provides a cmdlet wrapper so PowerShell scripts do not need to call Dispose directly.

Examples

Authored help example

Close without saving.

$ppt = Get-OfficePowerPoint -Path .\deck.pptx; Close-OfficePowerPoint -Presentation $ppt

Releases the loaded presentation instance.

Save, open, and close.

Close-OfficePowerPoint -Presentation $ppt -Save -Open

Saves the presentation, opens it in PowerPoint, and releases the object.

Parameters

-Open SwitchParameter optionalaliases: Show
Open the presentation after saving. Requires -Save or -Path.
-Password String optional
Password used to save the presentation as an encrypted package.
-Path String optionalaliases: FilePath
Optional target path when saving.
-Presentation PowerPointPresentation requiredpipeline: True (ByValue)
Presentation to close.
-Save SwitchParameter optional
Persist changes before closing.

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.