API Reference
Cmdlet
Update-OfficeWordFields
Updates fields in a Word document.
Remarks
Refreshes page number fields and queues table-of-contents updates.
Examples
Example 1: Update fields before saving a generated report.
PS>
New-OfficeWord -Path .\Report.docx {
Add-OfficeWordParagraph -Text 'Release report'
Add-OfficeWordTableOfContents
Update-OfficeWordFields
}
Updates PAGE and NUMPAGES fields and marks TOC fields as dirty before saving.
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
Update-OfficeWordFields [-Document <WordDocument>] [-PassThru] [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- Document WordDocument
- Document to update when provided explicitly.
- PassThru SwitchParameter
- Emit the updated document.