API Reference
Cmdlet
Set-OfficeWordDocumentProperty
Sets a built-in or custom document property on a Word document.
Remarks
Sets a built-in or custom document property on a Word document.
Examples
Example 1: Set built-in and custom release metadata.
PS>
New-OfficeWord -Path .\QuarterlyReport.docx {
Set-OfficeWordDocumentProperty -Name Title -Value 'Quarterly Report'
Set-OfficeWordDocumentProperty -Name ReleaseStatus -Value 'Approved' -Custom
Add-OfficeWordParagraph -Text 'Approved quarterly report'
}
Get-OfficeWordDocumentProperty -Path .\QuarterlyReport.docx -Name Title, ReleaseStatus
Writes document metadata during composition and reads it back for proof.
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
Set-OfficeWordDocumentProperty [-Custom] [-Document <WordDocument>] -Name <String> [-PassThru] [-Value <Object>] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- Custom SwitchParameter
- Treat the property as a custom document property.
- Document WordDocument
- Document to update when provided explicitly.
- Name String
- Property name to update.
- PassThru SwitchParameter
- Emit the updated document.
- Value Object
- Property value.
Outputs
OfficeIMO.Word.WordDocument