Project

PSWriteOffice

PowerShell document automation across Word, Excel, PowerPoint, PDF, Reader, Confluence, Visio, and open text formats.

Stars 159
Forks 14
PowerShell Gallery downloads 158,661
Release v3.0.5
Language: C# Updated: 2026-09-03

API Reference

Cmdlet

Save-OfficeWord

Namespace PSWriteOffice
Inputs
OfficeIMO.Word.WordDocument
Outputs
OfficeIMO.Word.WordDocument

Saves a Word document without disposing it.

Remarks

Use Close-OfficeWord -Save when you want to save and dispose the document.

Examples

Authored help example

Save the open document.

PS>


$doc | Save-OfficeWord
        

Persists pending changes and keeps the document open.

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.

Syntax

Save-OfficeWord -Document <WordDocument> [-Open] [-PassThru] [-Password <String>] [-Path <String>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Parameters

Document WordDocument requiredposition: 0pipeline: True (ByValue)
Document to save.
Open SwitchParameter optionalposition: namedpipeline: Falsealiases: Show
Open the document after saving.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the document object for further processing.
Password String optionalposition: namedpipeline: False
Password used to save the document as an encrypted package.
Path String optionalposition: namedpipeline: Falsealiases: FilePath
Optional save-as path.

Outputs

OfficeIMO.Word.WordDocument