Cmdlet
Save-OfficeWord
Saves a live Word document without closing it.
Syntax
Save-OfficeWord
[-AllowLoss]
[-Document] <WordDocument>
[-PassThru]
[-Password <SecureString>]
[[-Path] <String>]
[-Show]
[<CommonParameters>]#Parameter set:
DocumentDescription
Uses the supplied path or associated destination. Omitted Password preserves loaded encryption. PassThru returns the saved FileInfo. The document must use explicit persistence.
Examples
Save and retain the live document for further editing.
Save-OfficeWord -Document $document -Path ./Report.docx -PassThru
Close-OfficeWord -Document $documentSave a loaded document with its existing encryption.
$document = Open-OfficeWord -Path ./Protected.docx -Password (Read-Host -AsSecureString)
$document | Save-OfficeWord
$document | Close-OfficeWordParameters
- -AllowLoss SwitchParameter
- Explicitly accept reported native-save reductions.
- -Document WordDocument
- Live Word document to save.
- -PassThru SwitchParameter
- Return the saved FileInfo.
- -Password SecureString
- Override the output password; omission preserves the document's loaded encryption.
- -Path String
- Optional new destination; omission uses the associated path.
- -Show SwitchParameter
- Open the saved file in its registered default application.
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.