Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

Stars 654
Forks 82
Open issues 1
Total downloads 4,320,051
Release OfficeIMO-v3.5.3
Language: C# Updated: 2026-11-03
Cmdlet

Set-OfficeWordDocumentProperty

Module
PSWriteOffice
Inputs
OfficeIMO.Word.WordDocument
Outputs
OfficeIMO.Word.WordDocument

Sets a built-in or custom document property on a Word document.

Syntax

Set-OfficeWordDocumentProperty
[-Custom]
[-Document <WordDocument>]
[-Name] <String>
[-PassThru]
[[-Value] <Object>]
[<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Set built-in and custom release metadata.

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.

Parameters

-Custom SwitchParameter optional
Treat the property as a custom document property.
-Document WordDocument optionalpipeline: True (ByValue)
Document to update when provided explicitly.
-Name String requiredposition: 0
Property name to update.
-PassThru SwitchParameter optional
Emit the updated document.
-Value Object optionalposition: 1
Property value.

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.