Cmdlet
Save-OfficeWord
Saves a Word document without disposing it.
Syntax
Save-OfficeWord
[-Document] <WordDocument>
[-Open]
[-PassThru]
[-Password <String>]
[-Path <String>]
[<CommonParameters>]#Parameter set:
All Parameter SetsDescription
Use Close-OfficeWord -Save when you want to save and dispose the document.
Examples
Save the open document.
$doc | Save-OfficeWordPersists pending changes and keeps the document open.
Parameters
- -Document WordDocument
- Document to save.
- -Open SwitchParameter
- Open the document after saving.
- -PassThru SwitchParameter
- Emit the document object for further processing.
- -Password String
- Password used to save the document as an encrypted package.
- -Path String
- Optional save-as path.
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.